[imp] PATCH: horde/imp and safe_mode=on

Steve Stavropoulos steve@math.upatras.gr
Sat Nov 9 20:14:58 2002


 Here is a small patch for horde/imp/other_horde_app so it can work with
php in safe_mode. The patch is against horde-2.1, imp-3.1

--- /home/adm/steve/.//webmail/horde/lib/base.php Thu Apr 18 01:58:27 2002
+++ lib/base.php        Tue Aug 27 02:34:17 2002
@@ -26,7 +26,8 @@
 error_reporting($conf['debug_level']);

 // set max execution time according to config settings
-set_time_limit($conf['max_exec_time']);
+if(!ini_get('safe_mode'))
+       set_time_limit($conf['max_exec_time']);

 // Horde base libraries
 require_once HORDE_BASE . '/lib/Horde.php';

 A patch like the above should be applied to every horde app in its
lib/base.php. For example the patch for imp is:

--- /home/adm/steve/.//webmail/horde/imp/lib/base.php   Fri Apr 12
19:57:55 2002
+++ imp/lib/base.php    Tue Aug 27 02:36:07 2002
@@ -45,7 +45,8 @@
 error_reporting($conf['debug_level']);

 // set max execution time according to config settings
-set_time_limit($conf['max_exec_time']);
+if(!ini_get('safe_mode'))
+       set_time_limit($conf['max_exec_time']);

 // set the umask according to config settings
 if (isset($conf['umask'])) {


 The only other thing that must be done so you can run horde/imp in safe
mode is in php.ini:

-safe_mode_allowed_env_vars = PHP_
+safe_mode_allowed_env_vars = PHP_,LANG

(that is for the LANG and LANGUAGE variables to work well)

 With these mods done, horde/imp runs perfect in safe_mode. (only thing
that doesn't work so far is wvHtml (if you try to enable it))



More information about the imp mailing list