diff --git a/extlib/PEAR.php b/extlib/PEAR.php index fcefa964a3..4c24c6006a 100644 --- a/extlib/PEAR.php +++ b/extlib/PEAR.php @@ -746,7 +746,7 @@ class PEAR { if (!extension_loaded($ext)) { // if either returns true dl() will produce a FATAL error, stop that - if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1) || !function_exists('dl')) { + if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1)) { return false; } if (OS_WINDOWS) { diff --git a/lib/common.php b/lib/common.php index 4524d50fa8..063d7d9d99 100644 --- a/lib/common.php +++ b/lib/common.php @@ -45,6 +45,14 @@ define('FOREIGN_FRIEND_RECV', 2); set_include_path(get_include_path() . PATH_SEPARATOR . INSTALLDIR . '/extlib/'); +# To protect against upstream libraries which haven't updated +# for PHP 5.3 where dl() function may not be present... +if (!function_exists('dl')) { + function dl($library) { + return false; + } +} + # global configuration object require_once('PEAR.php');