+/* get globals we may need */
+sqgetGlobalVar('key', $key, SQ_COOKIE);
+sqgetGlobalVar('username', $username, SQ_SESSION);
+sqgetGlobalVar('onetimepad', $onetimepad, SQ_SESSION);
+sqgetGlobalVar('delimiter', $delimiter, SQ_SESSION);
+sqgetGlobalVar('folder_name', $folder_name, SQ_POST);
+sqgetGlobalVar('subfolder', $subfolder, SQ_POST);
+sqgetGlobalVar('contain_subs', $contain_subs, SQ_POST);
+/* end of get globals */
+
+$folder_name = trim($folder_name);
+
+if (substr_count($folder_name, '"') || substr_count($folder_name, "\\") ||
+ substr_count($folder_name, $delimiter) || ($folder_name == '')) {
+ displayPageHeader($color, 'None');
+
+ plain_error_message(_("Illegal folder name. Please select a different name.").
+ '<BR><A HREF="../src/folders.php">'._("Click here to go back").'</A>.', $color);
+
+ exit;
+}
+
+$folder_name = imap_utf7_encode_local($folder_name);