Make WordPress Core

Changeset 11579


Ignore:
Timestamp:
06/16/2009 02:50:55 AM (15 years ago)
Author:
ryan
Message:

Don't write to htaccess every time page is saved. Add hard/soft flush flag to flush_rules(). Make sure fopen is successful and silence errors. Props Viper007Bond. fixes #10181 for 2.8.1

Location:
branches/2.8
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/2.8/wp-admin/admin.php

    r11318 r11579  
    147147    // Make sure rules are flushed
    148148    global $wp_rewrite;
    149     $wp_rewrite->flush_rules();
     149    $wp_rewrite->flush_rules(false);
    150150
    151151    exit();
  • branches/2.8/wp-admin/includes/misc.php

    r11530 r11579  
    7373        }
    7474
    75         $f = fopen( $filename, 'w' );
     75        if ( !$f = @fopen( $filename, 'w' ) )
     76            return false;
     77
    7678        $foundit = false;
    7779        if ( $markerdata ) {
  • branches/2.8/wp-includes/post.php

    r11467 r11579  
    11931193            clean_page_cache($child->ID);
    11941194
    1195         $wp_rewrite->flush_rules();
     1195        $wp_rewrite->flush_rules(false);
    11961196    } else {
    11971197        clean_post_cache($postid);
     
    33553355        if ( !defined('WP_IMPORTING') ) {
    33563356            global $wp_rewrite;
    3357             $wp_rewrite->flush_rules();
     3357            $wp_rewrite->flush_rules(false);
    33583358        }
    33593359    } else {
  • branches/2.8/wp-includes/rewrite.php

    r11450 r11579  
    18231823     * @since 2.0.1
    18241824     * @access public
    1825      */
    1826     function flush_rules() {
     1825     * @param $hard bool Whether to update .htaccess (hard flush) or just update rewrite_rules transient (soft flush). Default is true (hard).
     1826     */
     1827    function flush_rules($hard = true) {
    18271828        delete_transient('rewrite_rules');
    18281829        $this->wp_rewrite_rules();
    1829         if ( function_exists('save_mod_rewrite_rules') )
     1830        if ( $hard && function_exists('save_mod_rewrite_rules') )
    18301831            save_mod_rewrite_rules();
    1831         if ( function_exists('iis7_save_url_rewrite_rules') )
     1832        if ( $hard && function_exists('iis7_save_url_rewrite_rules') )
    18321833            iis7_save_url_rewrite_rules();
    18331834    }
Note: See TracChangeset for help on using the changeset viewer.