strpos doesn't work if the offending char is in the first position... use substr_count
[squirrelmail.git] / src / folders_create.php
index b847749c5d1344711c6648a86a780da31266ee00..d15927cbf0bc6e2ce0addac7a1ef787caf2d3d69 100644 (file)
@@ -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;