Ver código fonte

strpos doesn't work if the offending char is in the first position... use substr_count

Thijs Kinkhorst 23 anos atrás
pai
commit
9040c23833
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      src/folders_create.php

+ 3 - 3
src/folders_create.php

@@ -38,11 +38,11 @@ $imapConnection = sqimap_login($username, $key, $imapServerAddress, $imapPort, 0
 
 $folder_name = trim($folder_name);
 
-if (strpos($folder_name, "\"") || strpos($folder_name, "\\") ||
-    strpos($folder_name, "'") || strpos($folder_name, "$delimiter") ||
+if (substr_count($folder_name, "\"") || substr_count($folder_name, "\\") ||
+    substr_count($folder_name, "'")  || substr_count($folder_name, "$delimiter") ||
     ($folder_name == '')) {
     displayPageHeader($color, 'None');
-    echo "<html><body bgcolor=$color[4]>";
+
     plain_error_message(_("Illegal folder name.  Please select a different name.")."<BR><A HREF=\"../src/folders.php\">"._("Click here to go back")."</A>.", $color);
     sqimap_logout($imapConnection);
     exit;