diff --git a/swad_changelog.h b/swad_changelog.h index 57316348a..eccc21838 100644 --- a/swad_changelog.h +++ b/swad_changelog.h @@ -133,13 +133,14 @@ /****************************** Public constants *****************************/ /*****************************************************************************/ -#define Log_PLATFORM_VERSION "SWAD 15.192.1 (2016-04-10)" +#define Log_PLATFORM_VERSION "SWAD 15.192.2 (2016-04-11)" #define CSS_FILE "swad15.192.css" #define JS_FILE "swad15.190.1.js" // Number of lines (includes comments but not blank lines) has been got with the following command: // nl swad*.c swad*.h css/swad*.css py/swad*.py js/swad*.js soap/swad*.h sql/swad*.sql | tail -1 /* + Version 15.192.2: Apr 11, 2016 Fixed bug when getting forum post content. (199344 lines) Version 15.192.1: Apr 10, 2016 Remove image attached to forum post when the post is removed. (199340 lines) Version 15.192: Apr 10, 2016 Get image attached to forum post / message. (199332 lines) 6 changes necessary in database: diff --git a/swad_forum.c b/swad_forum.c index 54c40b7a9..a9764e7a5 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -4018,7 +4018,7 @@ void For_DelPst (void) struct UsrData UsrDat; time_t CreatTimeUTC; // Creation time of a message char Subject[Cns_MAX_BYTES_SUBJECT+1]; - char OriginalContent[Cns_MAX_BYTES_TEXT+1]; + char OriginalContent[Cns_MAX_BYTES_LONG_TEXT+1]; struct Image Image; bool ThreadDeleted = false; diff --git a/swad_image.c b/swad_image.c index e3969c9fe..bd88f7726 100644 --- a/swad_image.c +++ b/swad_image.c @@ -450,15 +450,18 @@ void Img_RemoveImageFile (const char *ImageName) { char FullPathImgPriv[PATH_MAX+1]; - /***** Build path to private file *****/ - sprintf (FullPathImgPriv,"%s/%s/%c%c/%s.jpg", - Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_IMG, - ImageName[0], - ImageName[1], - ImageName); + if (ImageName[0]) + { + /***** Build path to private file *****/ + sprintf (FullPathImgPriv,"%s/%s/%c%c/%s.jpg", + Cfg_PATH_SWAD_PRIVATE,Cfg_FOLDER_IMG, + ImageName[0], + ImageName[1], + ImageName); - /***** Remove private file *****/ - unlink (FullPathImgPriv); + /***** Remove private file *****/ + unlink (FullPathImgPriv); - // Public links are removed automatically after a period + // Public links are removed automatically after a period + } }