changeset 914:d42c398d8896

Moar work.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 27 Nov 2014 11:23:28 +0200
parents 211de08d40fd
children a6b4b7401508
files msite.inc.php
diffstat 1 files changed, 4 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/msite.inc.php	Thu Nov 27 11:20:42 2014 +0200
+++ b/msite.inc.php	Thu Nov 27 11:23:28 2014 +0200
@@ -141,21 +141,18 @@
     "type" => EFILE_IMAGE,
     "mime" => "image/png",
     "fext" => "png",
-    "test" => "^PNG image data",
   ),
   "JPEG" => array(
     "class" => EFILE_IMAGE,
     "type" => EFILE_IMAGE,
     "mime" => "image/jpeg",
     "fext" => "jpg",
-    "test" => "^JPEG image data",
   ),
   "GIF"  => array(
     "class" => EFILE_IMAGE,
     "type" => EFILE_IMAGE,
     "mime" => "image/gif",
     "fext" => "gif",
-    "test" => "^GIF image data",
   ),
 
   "MP3" => array(
@@ -1072,18 +1069,15 @@
   {
     $fdata["id"] = $fid;
 
-    if (isset($fdata["test"]))
-    {
-      if (preg_match("/".$fdata["test"]."/", $sdata))
-        return $fdata;
-    }
+    if (isset($fdata["test"]) && preg_match("/".$fdata["test"]."/", $sdata))
+      return $fdata;
     else
     if ($fdata["mime"] == $smime)
       return $fdata;
   }
 
-  stLogError("File '".$filename."' (".$smime.") did not match any allowed file types [".$sdata."].");
-  return stError("No matching allowed file type found for '".$smime."'.");
+  stLogError("File '".$filename."' (".$smime.") did not match any defined file types [".$sdata."].");
+  return stError("No matching defined file type found for '".$smime."'.");
 }