]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/common.php
Merge branch 'master' into 0.9.x
[quix0rs-gnu-social.git] / lib / common.php
index 6138200e49880f2da1688049613ac9d366025df5..94540e3a8520d8c8c7eb6db42928aaa0ba3eefa3 100644 (file)
@@ -63,8 +63,13 @@ if (!function_exists('dl')) {
     // Fortunately trying to call the disabled one will only trigger
     // a warning, not a fatal, so it's safe to leave it for our case.
     // Callers will be suppressing warnings anyway.
-    $disabled = array_filter(array_map('trim', explode(',', ini_get('disable_functions'))));
-    if (!in_array('dl', $disabled)) {
+    try {
+        // Reading the ini setting is hard as we don't know PHP's parsing,
+        // but we can check if it is disabled through reflection.
+        $dl = new ReflectionFunction('dl');
+        // $disabled = $dl->isDisabled(); // don't need to check this now
+    } catch (ReflectionException $e) {
+        // Ok, it *really* doesn't exist!
         function dl($library) {
             return false;
         }