From: Tomas V.V.Cox Date: Tue, 8 Jul 2003 10:52:23 +0000 (+0000) Subject: Detect enable_dl off or safe_mode on PEAR::loadExtension() X-Git-Tag: BEFORE_ARG_INFO~327 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=287363df6309336e8aad164c25cce143211625a4;p=php Detect enable_dl off or safe_mode on PEAR::loadExtension() --- diff --git a/pear/PEAR.php b/pear/PEAR.php index 84994fee17..5305537fb1 100644 --- a/pear/PEAR.php +++ b/pear/PEAR.php @@ -225,7 +225,7 @@ class PEAR * @param mixed $data the value to test * @param int $code if $data is an error object, return true * only if $code is a string and - * $obj->getMessage() == $code or + * $obj->getMessage() == $code or * $code is an integer and $obj->getCode() == $code * @access public * @return bool true if parameter is an error @@ -621,6 +621,10 @@ class PEAR function loadExtension($ext) { 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)) { + return false; + } if (OS_WINDOWS) { $suffix = '.dll'; } elseif (PHP_OS == 'HP-UX') {