Переглянути джерело

need to move strtolower inside if-block to prevent notice when attached
file has no extention

Thijs Kinkhorst 15 роки тому
батько
коміт
e895b91d5d
1 змінених файлів з 2 додано та 3 видалено
  1. 2 3
      functions/attachment_common.php

+ 2 - 3
functions/attachment_common.php

@@ -269,11 +269,10 @@ function attachment_common_octet_stream(&$Args) {
 
     $Ext = '';
     if (is_array($Regs) && isset($Regs[1])) {
-       $Ext = $Regs[1];
+        $Ext = $Regs[1];
+        $Ext = strtolower($Regs[1]);
     }
 
-    $Ext = strtolower($Regs[1]);
-
     if ($Ext == '' || ! isset($FileExtensionToMimeType[$Ext]))
         return;