Changeset 23305 for trunk/wp-includes/canonical.php
- Timestamp:
- 01/18/2013 01:44:22 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/canonical.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/canonical.php
r21813 r23305 273 273 } 274 274 275 $redirect['path'] = user_trailingslashit( preg_replace('|/ index.php/?$|', '/', $redirect['path']) ); // strip off trailing /index.php/276 if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($redirect['path'], '/ index.php/') === false )277 $redirect['path'] = trailingslashit($redirect['path']) . 'index.php/';275 $redirect['path'] = user_trailingslashit( preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/?$|', '/', $redirect['path']) ); // strip off trailing /index.php/ 276 if ( !empty( $addl_path ) && $wp_rewrite->using_index_permalinks() && strpos($redirect['path'], '/' . $wp_rewrite->index . '/') === false ) 277 $redirect['path'] = trailingslashit($redirect['path']) . $wp_rewrite->index . '/'; 278 278 if ( !empty( $addl_path ) ) 279 279 $redirect['path'] = trailingslashit($redirect['path']) . $addl_path; … … 325 325 326 326 // trailing /index.php 327 $redirect['path'] = preg_replace('|/ index.php/*?$|', '/', $redirect['path']);327 $redirect['path'] = preg_replace('|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path']); 328 328 329 329 // Remove trailing spaces from the path … … 346 346 // strip /index.php/ when we're not using PATHINFO permalinks 347 347 if ( !$wp_rewrite->using_index_permalinks() ) 348 $redirect['path'] = str_replace( '/index.php/', '/', $redirect['path']);348 $redirect['path'] = str_replace( '/' . $wp_rewrite->index . '/', '/', $redirect['path'] ); 349 349 350 350 // trailing slashes
Note: See TracChangeset
for help on using the changeset viewer.