Browse Source

Quote dynamic regex contents to be safe. Thanks to Daniel Hahler.

pdontthink 15 years ago
parent
commit
172b91e466
1 changed files with 1 additions and 1 deletions
  1. 1 1
      functions/folder_manip.php

+ 1 - 1
functions/folder_manip.php

@@ -226,7 +226,7 @@ function folders_delete_do ($imapConnection, $delimiter, $folder_name)
 
     /** lets see if we CAN move folders to the trash.. otherwise,
         ** just delete them **/
-    if ($delete_folder || preg_match('/^' . $trash_folder . '.+/i', $folder_name) ) {
+    if ($delete_folder || preg_match('/^' . preg_quote($trash_folder, '/') . '.+/i', $folder_name) ) {
         $can_move_to_trash = FALSE;
     } else {
     /* Otherwise, check if trash folder exits and support sub-folders */