Make WordPress Core


Ignore:
Timestamp:
11/10/2005 11:25:39 PM (19 years ago)
Author:
ryan
Message:

Add radio button for our default permalink structure. Add got_mod_rewrite(). Props Mark Jaquith. fixes #1840

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-functions.php

    r3000 r3029  
    976976}
    977977
     978function got_mod_rewrite() {
     979    global $is_apache;
     980
     981    // take 3 educated guesses as to whether or not mod_rewrite is available
     982    if ( !$is_apache )
     983        return false;
     984
     985    if ( function_exists('apache_get_modules') ) {
     986        if ( !in_array('mod_rewrite', apache_get_modules()) )
     987            return false;
     988    }
     989
     990    if ( function_exists('ob_get_clean') ) {
     991      ob_start();
     992      phpinfo(INFO_MODULES);
     993      $php_modules = ob_get_clean();
     994      if ( strpos($php_modules, 'mod_rewrite') === false)
     995        return false;
     996    }
     997
     998    return true;
     999}
     1000
    9781001function save_mod_rewrite_rules() {
    9791002    global $is_apache, $wp_rewrite;
     
    9861009        return;
    9871010
    988     if (!$is_apache)
     1011    if (! got_mod_rewrite())
    9891012        return;
    9901013
Note: See TracChangeset for help on using the changeset viewer.