Changeset 36307 for trunk/src/wp-includes/rewrite.php
- Timestamp:
- 01/15/2016 07:55:19 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rewrite.php
r36217 r36307 479 479 } 480 480 481 // Get rid of the #anchor 482 $url_split = explode('#', $url); 483 $url = $url_split[0]; 484 485 // Get rid of URL ?query=string 486 $url_split = explode('?', $url); 487 $url = $url_split[0]; 488 489 // Set the correct URL scheme. 490 $url = set_url_scheme( $url ); 491 492 // Add 'www.' if it is absent and should be there 493 if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') ) 494 $url = str_replace('://', '://www.', $url); 495 496 // Strip 'www.' if it is present and shouldn't be 497 if ( false === strpos(home_url(), '://www.') ) 498 $url = str_replace('://www.', '://', $url); 499 500 if ( trim( $url, '/' ) === home_url() && 'page' == get_option( 'show_on_front' ) ) { 501 $page_on_front = get_option( 'page_on_front' ); 502 503 if ( $page_on_front && get_post( $page_on_front ) instanceof WP_Post ) { 504 return (int) $page_on_front; 505 } 506 } 507 481 508 // Check to see if we are using rewrite rules 482 509 $rewrite = $wp_rewrite->wp_rewrite_rules(); … … 485 512 if ( empty($rewrite) ) 486 513 return 0; 487 488 // Get rid of the #anchor489 $url_split = explode('#', $url);490 $url = $url_split[0];491 492 // Get rid of URL ?query=string493 $url_split = explode('?', $url);494 $url = $url_split[0];495 496 // Set the correct URL scheme.497 $url = set_url_scheme( $url );498 499 // Add 'www.' if it is absent and should be there500 if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') )501 $url = str_replace('://', '://www.', $url);502 503 // Strip 'www.' if it is present and shouldn't be504 if ( false === strpos(home_url(), '://www.') )505 $url = str_replace('://www.', '://', $url);506 514 507 515 // Strip 'index.php/' if we're not using path info permalinks
Note: See TracChangeset
for help on using the changeset viewer.