# HG changeset patch # User Matti Hamalainen # Date 1416920166 -7200 # Node ID f03c4e9aad29d98c34a44fe5afa6c4f0ca2f5420 # Parent bd1cfc7b52d28e52c5c60d74fdf2908fa675a95b Improve error logging. diff -r bd1cfc7b52d2 -r f03c4e9aad29 msite.inc.php --- a/msite.inc.php Tue Nov 25 14:11:20 2014 +0200 +++ b/msite.inc.php Tue Nov 25 14:56:06 2014 +0200 @@ -1002,7 +1002,7 @@ // Get file magic info if (($finfo = finfo_open()) === false) { - error_log("Internal error. Failed to initialize finfo().\n"); + error_log("Internal error. Failed to initialize finfo()."); return stError("Internal error, failed to probe file."); } @@ -1013,7 +1013,7 @@ // Did we get anything? if ($sdata === FALSE || $smime === FALSE) { - error_log("Failed to probe file '".$filename."'.\n"); + error_log("Failed to probe file '".$filename."'."); return stError("Internal error, failed to probe file."); } @@ -1032,7 +1032,8 @@ return $fdata; } - return stError("No matching allowed file type found."); + error_log("File '".$filename."' (".$smime.") did not match any allowed file types."); + return stError("No matching allowed file type found for '".$smime."'."); } @@ -1186,7 +1187,7 @@ // Set permissions before moving the file if (chmod($tmpFilename, stGetSetting($uploadType."PathPerms")) === false) { - error_log("Could not set permissions for uploaded file '".$tmpFilename."'.\n"); + error_log("Could not set permissions for uploaded file '".$tmpFilename."'."); return stError("Could not set permissions for uploaded file."); } @@ -1194,7 +1195,7 @@ $fullFile = stMakePath(FALSE, FALSE, array(stGetSetting($uploadType."Path"), $compo["cpath"], $filename)); if (@move_uploaded_file($tmpFilename, $fullFile) === false) { - error_log("Could not move uploaded file '".$tmpFilename."' to '".$fullFile."'.\n"); + error_log("Could not move uploaded file '".$tmpFilename."' to '".$fullFile."'."); return stError("Deploying uploaded file failed."); }