Ticket #11848: 11848.diff

File 11848.diff, 813 bytes (added by Denis-de-Bernardy, 3 years ago)
Line 
1Index: wp-includes/functions.php
2===================================================================
3--- wp-includes/functions.php   (revision 12659)
4+++ wp-includes/functions.php   (working copy)
5@@ -3091,17 +3091,16 @@
6        if ( !$is_apache )
7                return false;
8 
9-       if ( function_exists('apache_get_modules') ) {
10-               $mods = apache_get_modules();
11-               if ( in_array($mod, $mods) )
12-                       return true;
13-       } elseif ( function_exists('phpinfo') ) {
14-                       ob_start();
15-                       phpinfo(8);
16-                       $phpinfo = ob_get_clean();
17-                       if ( false !== strpos($phpinfo, $mod) )
18-                               return true;
19-       }
20+       if ( function_exists('apache_get_modules') )
21+               return in_array($mod, apache_get_modules());
22+       
23+       ob_start();
24+       phpinfo(INFO_MODULES);
25+       $phpinfo = ob_get_clean();
26+
27+       if ( false !== strpos($phpinfo, $mod) )
28+               return true;
29+
30        return $default;
31 }
32