strpos doesn't work if the offending char is in the first position... use substr_count
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 23 Oct 2002 12:52:30 +0000 (12:52 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 23 Oct 2002 12:52:30 +0000 (12:52 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3946 7612ce4b-ef26-0410-bec9-ea0150e637f0

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;