summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/media.php3
1 files changed, 1 insertions, 2 deletions
diff --git a/inc/media.php b/inc/media.php
index 7e1b2152d..bd80db577 100644
--- a/inc/media.php
+++ b/inc/media.php
@@ -237,8 +237,7 @@ function media_upload_xhr($ns,$auth){
$realSize = stream_copy_to_stream($input, $target);
fclose($target);
fclose($input);
- if ($realSize != (int)$_SERVER["CONTENT_LENGTH"]){
- unlink($target);
+ if (isset($_SERVER["CONTENT_LENGTH"]) && ($realSize != (int)$_SERVER["CONTENT_LENGTH"])){
unlink($path);
return false;
}