From fed6fccbc7ab83ed9c5a79f484d8a6664cb95bc3 Mon Sep 17 00:00:00 2001
From: Anika Henke <anika@selfthinker.org>
Date: Sat, 16 Feb 2013 13:33:01 +0000
Subject: [PATCH] fixed media upload not working with QuickPHP (FS#2531 +
 FS#2673)

---
 inc/media.php | 3 +--
 1 file changed, 1 insertion(+), 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;
     }
-- 
GitLab