Prevent endless recursive sent subfolder names - see: http://thread.gmane.org/gmane...
[squirrelmail.git] / plugins / sent_subfolders / functions.php
index 8225199714b1a46f7e9326982def72e14c377f33..4cf6e5605960d8229964283ca05faf6ce30f41e1 100644 (file)
@@ -5,7 +5,7 @@
  *
  * This is a standard SquirrelMail 1.2 API for plugins.
  *
- * @copyright © 1999-2009 The SquirrelMail Project Team
+ * @copyright 1999-2012 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package plugins
@@ -131,6 +131,10 @@ function save_option_sent_subfolders_setting($option) {
     } else {
         setPref($data_dir, $username, 'use_sent_subfolders', SMPREF_ON);
         setPref($data_dir, $username, 'move_to_sent', SMPREF_ON);
+        $check_sent_subfolders_base = getPref($data_dir, $username, 'sent_subfolders_base', '');
+        if ($check_sent_subfolders_base === '') {
+            setPref($data_dir, $username, 'sent_subfolders_base', $sent_subfolders_base);
+        }
     }
 
     /* Now just save the option as normal. */