allow deleting and renaming of pastes with only binary files
authorChristian Weiske <cweiske@cweiske.de>
Tue, 12 Nov 2013 18:43:19 +0000 (19:43 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 12 Nov 2013 18:43:19 +0000 (19:43 +0100)
src/phorkie/Repository/Post.php

index 0860cad..226c2d8 100644 (file)
@@ -178,7 +178,15 @@ class Repository_Post
             if ($_FILES['files']['error'][$num]['upload'] == 0) {
                 return true;
             }
-            if ($arFile['content'] != '') {
+            if (isset($arFile['content']) && $arFile['content'] != '') {
+                return true;
+            }
+            if (isset($arFile['name']) && $arFile['name'] != '') {
+                //binary files do not have content
+                return true;
+            }
+            if (isset($arFile['delete']) && $arFile['delete'] != '') {
+                //binary files do not have content
                 return true;
             }
         }