WordPress.org

Make WordPress Core

Ticket #6481: 6481.2.diff

File 6481.2.diff, 1.2 KB (added by Denis-de-Bernardy, 11 years ago)
  • wp-includes/rewrite.php

     
    17851785        function flush_rules() {
    17861786                delete_transient('rewrite_rules');
    17871787                $this->wp_rewrite_rules();
    1788                 if ( function_exists('save_mod_rewrite_rules') )
    1789                         save_mod_rewrite_rules();
     1788                return function_exists('save_mod_rewrite_rules') ? save_mod_rewrite_rules() : true;
    17901789        }
    17911790
    17921791        /**
  • wp-admin/includes/upgrade.php

     
    6969
    7070        wp_install_defaults($user_id);
    7171
    72         $wp_rewrite->flush_rules();
     72        if ( got_mod_rewrite() && is_file(ABSPATH . '.htaccess') && is_writable(ABSPATH . '.htaccess') )
     73                $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
    7374
     75        if ( !$wp_rewrite->flush_rules() ) {
     76                $wp_rewrite->set_permalink_structure('');
     77                $wp_rewrite->flush_rules()
     78        }
     79
    7480        wp_new_blog_notification($blog_title, $guessurl, $user_id, $random_password);
    7581
    7682        wp_cache_flush();