Changeset 27549
- Timestamp:
- 03/15/2014 04:34:23 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/options-permalink.php
r27469 r27549 118 118 } 119 119 120 $permalink_structure = get_option('permalink_structure'); 121 $category_base = get_option('category_base'); 122 $tag_base = get_option( 'tag_base' ); 120 $permalink_structure = get_option( 'permalink_structure' ); 121 $category_base = get_option( 'category_base' ); 122 $tag_base = get_option( 'tag_base' ); 123 $update_required = false; 123 124 124 125 if ( $iis7_permalinks ) { … … 130 131 $writable = false; 131 132 } else { 132 if ( ( ! file_exists( $home_path . '.htaccess') && is_writable($home_path) ) || is_writable($home_path . '.htaccess') )133 if ( ( ! file_exists( $home_path . '.htaccess' ) && is_writable( $home_path ) ) || is_writable( $home_path . '.htaccess' ) ) { 133 134 $writable = true; 134 else135 } else { 135 136 $writable = false; 137 $existing_rules = array_filter( extract_from_markers( $home_path . '.htaccess', 'WordPress' ) ); 138 $new_rules = array_filter( explode( "\n", $wp_rewrite->mod_rewrite_rules() ) ); 139 $update_required = ( $new_rules !== $existing_rules ); 140 } 136 141 } 137 142 … … 158 163 _e('Permalink structure updated.'); 159 164 } else { 160 if ( $permalink_structure && ! $usingpi && ! $writable )165 if ( $permalink_structure && ! $usingpi && ! $writable && $update_required ) { 161 166 _e('You should update your .htaccess now.'); 162 else167 } else { 163 168 _e('Permalink structure updated.'); 169 } 164 170 } 165 171 } else { … … 274 280 <?php endif; ?> 275 281 <?php elseif ( ! $is_nginx ) : 276 if ( $permalink_structure && ! $usingpi && ! $writable ) : ?>282 if ( $permalink_structure && ! $usingpi && ! $writable && $update_required ) : ?> 277 283 <p><?php _e('If your <code>.htaccess</code> file were <a href="http://codex.wordpress.org/Changing_File_Permissions">writable</a>, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your <code>.htaccess</code> file. Click in the field and press <kbd>CTRL + a</kbd> to select all.') ?></p> 278 284 <form action="options-permalink.php" method="post">
Note: See TracChangeset
for help on using the changeset viewer.