summaryrefslogtreecommitdiff
path: root/extlib
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2009-09-01 20:04:36 -0300
committerCraig Andrews <candrews@integralblue.com>2009-09-13 21:53:30 -0400
commitfe9473ac7810d317e001a0fec19cbacaafc0c909 (patch)
tree665ceaec4aa1d19b4ca91c2b59bda7d78f9db939 /extlib
parent4a19c292fb444dca840591a5ccec960d63ab57b8 (diff)
Check that 'dl' function is available and usable before trying to call it with error suppression; if it's disabled or unavailable we end up with mysterious failures during installation or loading of libraries.
Fixed for StatusNet installer as well as some external libraries that should be fixed upstream if they haven't already been: * PEAR * Auth/OpenID * Auth/Yadis
Diffstat (limited to 'extlib')
-rw-r--r--extlib/Auth/OpenID/BigMath.php2
-rw-r--r--extlib/Auth/Yadis/XML.php2
-rw-r--r--extlib/PEAR.php2
3 files changed, 3 insertions, 3 deletions
diff --git a/extlib/Auth/OpenID/BigMath.php b/extlib/Auth/OpenID/BigMath.php
index 45104947d..b5fc627a0 100644
--- a/extlib/Auth/OpenID/BigMath.php
+++ b/extlib/Auth/OpenID/BigMath.php
@@ -376,7 +376,7 @@ function Auth_OpenID_detectMathLibrary($exts)
// Try to load dynamic modules.
if (!$loaded) {
foreach ($extension['modules'] as $module) {
- if (@dl($module . "." . PHP_SHLIB_SUFFIX)) {
+ if (function_exists('dl') && ini_get('enable_dl') && !ini_get('safe_mode') && @dl($module . "." . PHP_SHLIB_SUFFIX)) {
$loaded = true;
break;
}
diff --git a/extlib/Auth/Yadis/XML.php b/extlib/Auth/Yadis/XML.php
index 4854f12bb..7232d6cbd 100644
--- a/extlib/Auth/Yadis/XML.php
+++ b/extlib/Auth/Yadis/XML.php
@@ -349,7 +349,7 @@ function &Auth_Yadis_getXMLParser()
foreach ($extensions as $name => $params) {
if (!extension_loaded($name)) {
foreach ($params['libname'] as $libname) {
- if (@dl($libname)) {
+ if (function_exists('dl') && ini_get('enable_dl') && !ini_get('safe_mode') && @dl($libname)) {
$classname = $params['classname'];
}
}
diff --git a/extlib/PEAR.php b/extlib/PEAR.php
index 4c24c6006..fcefa964a 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)) {
+ if ((ini_get('enable_dl') != 1) || (ini_get('safe_mode') == 1) || !function_exists('dl')) {
return false;
}
if (OS_WINDOWS) {