From: kink Date: Wed, 23 Oct 2002 12:52:30 +0000 (+0000) Subject: strpos doesn't work if the offending char is in the first position... use substr_count X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=3d3afeebd8d55034445c790ed53f3c9f786318b0 strpos doesn't work if the offending char is in the first position... use substr_count git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3946 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/src/folders_create.php b/src/folders_create.php index b847749c..d15927cb 100644 --- a/src/folders_create.php +++ b/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 ""; + plain_error_message(_("Illegal folder name. Please select a different name.")."
"._("Click here to go back").".", $color); sqimap_logout($imapConnection); exit;