Ticket #19268: htaccesscheckv2.diff
| File htaccesscheckv2.diff, 2.7 KB (added by ldebrouwer, 18 months ago) |
|---|
-
wp-admin/options-permalink.php
124 124 else 125 125 $usingpi = false; 126 126 127 if (isset($_POST['submit'])) : 128 $requpdate = true; 129 if ( ! $iis7_permalinks ) { 130 $content = @file_get_contents($home_path . '.htaccess'); 131 if ( $content && preg_match('/# BEGIN WordPress([^#]*)# END WordPress/im', $content, $matches) ) { 132 if ( isset ( $matches[1] ) && ( trim( $wp_rewrite->mod_rewrite_rules() ) == trim( $matches[1] ) ) ) { 133 $requpdate = false; 134 } else { 135 $requpdate = true; 136 } 137 } 138 } 139 endif; 140 127 141 $wp_rewrite->flush_rules(); 128 142 129 130 if (isset($_POST['submit'])) : ?> 143 if (isset($_POST['submit'])) : 144 if ( $requpdate ) { 145 ?> 131 146 <div id="message" class="updated"><p><?php 132 if ( ! is_multisite() ) { 133 if ( $iis7_permalinks ) { 134 if ( $permalink_structure && ! $usingpi && ! $writable ) 135 _e('You should update your web.config now'); 136 else if ( $permalink_structure && ! $usingpi && $writable ) 137 _e('Permalink structure updated. Remove write access on web.config file now!'); 138 else 139 _e('Permalink structure updated'); 147 if ( ! is_multisite() ) { 148 if ( $iis7_permalinks ) { 149 if ( $permalink_structure && ! $usingpi && ! $writable ) 150 _e('You should update your web.config now'); 151 else if ( $permalink_structure && ! $usingpi && $writable ) 152 _e('Permalink structure updated. Remove write access on web.config file now!'); 153 else 154 _e('Permalink structure updated'); 155 } else { 156 if ( $permalink_structure && ! $usingpi && ! $writable ) 157 _e('You should update your .htaccess now.'); 158 else 159 _e('Permalink structure updated.'); 160 } 140 161 } else { 141 if ( $permalink_structure && ! $usingpi && ! $writable ) 142 _e('You should update your .htaccess now.'); 143 else 144 _e('Permalink structure updated.'); 162 _e('Permalink structure updated.'); 145 163 } 146 } else {147 _e('Permalink structure updated.');148 }149 164 ?> 150 165 </p></div> 166 <?php } ?> 151 167 <?php endif; ?> 152 168 153 169 <div class="wrap"> … … 252 268 <?php endif; ?> 253 269 <?php endif; ?> 254 270 <?php else : 255 if ( $permalink_structure && ! $usingpi && ! $writable ) : ?>271 if ( $permalink_structure && ! $usingpi && ! $writable && $requpdate ) : ?> 256 272 <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> 257 273 <form action="options-permalink.php" method="post"> 258 274 <?php wp_nonce_field('update-permalink') ?>
