From bf9135ebfce01818a1690a6902e5ea66593ddaf1 Mon Sep 17 00:00:00 2001 From: Yandols Date: Mon, 5 Feb 2018 03:57:08 +0800 Subject: [PATCH] Updated current uploader code to state endpoint version used in logs to identify between this one and the new uploader. Also pointed error page towards the revamped one. --- upload.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/upload.php b/upload.php index 420fbee..0e0d20c 100644 --- a/upload.php +++ b/upload.php @@ -1,5 +1,6 @@ 6291456) { echo "Sorry, your file is too large. (Max is 6MB)"; $uploadOk = 0; - header('Location: ./uploadfailed.php'); + header('Location: ./failed.php'); } // Allow certain file formats // Fixed uppercase rejection bug in 1.1a @@ -37,12 +38,12 @@ if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg && $imageFileType != "GIF" && $imageFileType != "SVG" ) { echo "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; $uploadOk = 0; - header('Location: ./uploadfailed.php'); + header('Location: ./failed.php'); } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file could not be uploaded."; - header('Location: ./uploadfailed.php'); + header('Location: ./failed.php'); // if everything is ok, try to upload file } else { // 1.2a -- Changed some case-confusing characters such as I and O to web safe symbols. @@ -60,7 +61,7 @@ if ($uploadOk == 0) { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $newtarget)) { chmod("$newtarget", 0775); // Set read and write permissions if file echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded."; - $uploaderlog = "" . date('U') . ", ". date('Y-m-d H:i:s e') . ", $_SERVER[REMOTE_ADDR], $newfilename" . ", $_SERVER[HTTP_USER_AGENT]"; + $uploaderlog = "" . date('U') . ", ". date('Y-m-d H:i:s e') . ", $_SERVER[REMOTE_ADDR], $newfilename" . ", " . $imejicoreversion . ", $_SERVER[HTTP_USER_AGENT]"; //$uploaderlog = "Unix Time: " . date('U') . ", Logical Time: ". date('Y-m-d H:i:s e') . ", IP Address: $_SERVER[REMOTE_ADDR], Filename: $newfilename" . ", User Agent: $_SERVER[HTTP_USER_AGENT], Referer: $_SERVER[HTTP_REFERER]"; --simplified in v0.9e file_put_contents('uploads.log', $uploaderlog . PHP_EOL, FILE_APPEND); header('Location: https://i.zxicar.us/' . $newfilename); @@ -69,7 +70,7 @@ if ($uploadOk == 0) { //header('Location: http://zxicar.us/imeji/'.basename( $_FILES["fileToUpload"]["name"])); --changed as of v0.2 } else { echo "Sorry, there was a problem uploading your file."; - header('Location: ./uploadfailed.php'); + header('Location: ./failed.php'); } } ?>