Ticket #7337: wp-rewrite-index.diff
File wp-rewrite-index.diff, 4.9 KB (added by , 13 years ago) |
---|
-
wp-includes/nav-menu-template.php
Property changes on: . ___________________________________________________________________ Added: svn:ignore + .wp-tests-version
367 367 $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_root_relative_current ); 368 368 $raw_item_url = strpos( $menu_item->url, '#' ) ? substr( $menu_item->url, 0, strpos( $menu_item->url, '#' ) ) : $menu_item->url; 369 369 $item_url = untrailingslashit( $raw_item_url ); 370 $_indexless_current = untrailingslashit( preg_replace( '/ index.php$/', '', $current_url ) );370 $_indexless_current = untrailingslashit( preg_replace( '/' . preg_quote( $wp_rewrite->index, '/' ) . '$/', '', $current_url ) ); 371 371 372 372 if ( $raw_item_url && in_array( $item_url, array( $current_url, $_indexless_current, $_root_relative_current ) ) ) { 373 373 $classes[] = 'current-menu-item'; -
wp-includes/link-template.php
1445 1445 } 1446 1446 1447 1447 $request = preg_replace( "|$wp_rewrite->pagination_base/\d+/?$|", '', $request); 1448 $request = preg_replace( '|^ index\.php|i', '', $request);1448 $request = preg_replace( '|^' . preg_quote( $wp_rewrite->index, '|' ) . '|i', '', $request); 1449 1449 $request = ltrim($request, '/'); 1450 1450 1451 1451 $base = trailingslashit( get_bloginfo( 'url' ) ); 1452 1452 1453 1453 if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' != $request ) ) 1454 $base .= 'index.php/';1454 $base .= $wp_rewrite->index . '/'; 1455 1455 1456 1456 if ( $pagenum > 1 ) { 1457 1457 $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . "/" . $pagenum, 'paged' ); -
wp-includes/rewrite.php
315 315 316 316 // Strip 'index.php/' if we're not using path info permalinks 317 317 if ( !$wp_rewrite->using_index_permalinks() ) 318 $url = str_replace( 'index.php/', '', $url);318 $url = str_replace( $wp_rewrite->index . '/', '', $url ); 319 319 320 320 if ( false !== strpos($url, home_url()) ) { 321 321 // Chop off http://domain.com -
wp-includes/canonical.php
272 272 $redirect['query'] = remove_query_arg( 'cpage', $redirect['query'] ); 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; 280 280 $redirect_url = $redirect['scheme'] . '://' . $redirect['host'] . $redirect['path']; … … 324 324 unset($redirect['port']); 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 330 330 $redirect['path'] = preg_replace( '#(%20| )+$#', '', $redirect['path'] ); … … 345 345 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 351 351 if ( is_object($wp_rewrite) && $wp_rewrite->using_permalinks() && !is_404() && (!is_front_page() || ( is_front_page() && (get_query_var('paged') > 1) ) ) ) { -
wp-admin/options-permalink.php
227 227 <?php 228 228 $suffix = ''; 229 229 if ( ! $is_apache && ! $iis7_permalinks ) 230 $suffix = 'index.php/';230 $suffix = $wp_rewrite->index . '/'; 231 231 ?> 232 232 <p><?php 233 233 /* translators: %s is a placeholder that must come at the start of the URL path. */