Просмотр исходного кода

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

Thijs Kinkhorst 15 лет назад
Родитель
Сommit
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 = '';
     $Ext = '';
     if (is_array($Regs) && isset($Regs[1])) {
     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]))
     if ($Ext == '' || ! isset($FileExtensionToMimeType[$Ext]))
         return;
         return;