Reture true from got_mod_rewrite if we can't determine if the module is loaded. Add got_rewrite filter. Props andy. fixes #6278

git-svn-id: http://svn.automattic.com/wordpress/trunk@7508 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-03-25 00:22:37 +00:00
parent faff475746
commit 064322eded
2 changed files with 6 additions and 4 deletions

View File

@ -1,7 +1,8 @@
<?php
function got_mod_rewrite() {
return apache_mod_loaded('mod_rewrite');
$got_rewrite = apache_mod_loaded('mod_rewrite', true);
return apply_filters('got_rewrite', $got_rewrite);
}
// Returns an array of strings from a file (.htaccess ) from between BEGIN

View File

@ -1725,9 +1725,10 @@ function is_lighttpd_before_150() {
* apache_mod_loaded() - Does the specified module exist in the apache config?
*
* @param string $mod e.g. mod_rewrite
* @param bool $default The default return value if the module is not found
* @return bool
*/
function apache_mod_loaded($mod) {
function apache_mod_loaded($mod, $default = false) {
global $is_apache;
if ( !$is_apache )
@ -1737,14 +1738,14 @@ function apache_mod_loaded($mod) {
$mods = apache_get_modules();
if ( in_array($mod, $mods) )
return true;
} else {
} elseif ( function_exists('phpinfo') ) {
ob_start();
phpinfo(8);
$phpinfo = ob_get_clean();
if ( false !== strpos($phpinfo, $mod) )
return true;
}
return false;
return $default;
}
?>