Changeset 7508

Show
Ignore:
Timestamp:
03/25/08 00:22:37 (6 months ago)
Author:
ryan
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/includes/misc.php

    r7441 r7508  
    22 
    33function got_mod_rewrite() { 
    4     return apache_mod_loaded('mod_rewrite'); 
     4    $got_rewrite = apache_mod_loaded('mod_rewrite', true); 
     5    return apply_filters('got_rewrite', $got_rewrite); 
    56} 
    67 
  • trunk/wp-includes/functions.php

    r7478 r7508  
    17261726 * 
    17271727 * @param string $mod e.g. mod_rewrite 
     1728 * @param bool $default The default return value if the module is not found 
    17281729 * @return bool 
    17291730 */ 
    1730 function apache_mod_loaded($mod) { 
     1731function apache_mod_loaded($mod, $default = false) { 
    17311732    global $is_apache; 
    17321733 
     
    17381739        if ( in_array($mod, $mods) ) 
    17391740            return true; 
    1740     } else
     1741    } elseif ( function_exists('phpinfo') )
    17411742            ob_start(); 
    17421743            phpinfo(8); 
     
    17451746                return true; 
    17461747    } 
    1747     return false
     1748    return $default
    17481749} 
    17491750