Changeset 56939
- Timestamp:
- 10/16/2023 12:05:28 AM (12 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/link-template.php
r56767 r56939 2432 2432 preg_match( $qs_regex, $request, $qs_match ); 2433 2433 2434 $parts = array(); 2435 $parts[] = untrailingslashit( get_bloginfo( 'url' ) ); 2436 2434 2437 if ( ! empty( $qs_match[0] ) ) { 2435 2438 $query_string = $qs_match[0]; … … 2443 2446 $request = ltrim( $request, '/' ); 2444 2447 2445 $base = trailingslashit( get_bloginfo( 'url' ) );2446 2447 2448 if ( $wp_rewrite->using_index_permalinks() && ( $pagenum > 1 || '' !== $request ) ) { 2448 $base .= $wp_rewrite->index . '/'; 2449 } 2449 $parts[] = $wp_rewrite->index; 2450 } 2451 2452 $parts[] = untrailingslashit( $request ); 2450 2453 2451 2454 if ( $pagenum > 1 ) { 2452 $request = ( ( ! empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( $wp_rewrite->pagination_base . '/' . $pagenum, 'paged' ); 2453 } 2454 2455 $result = $base . $request . $query_string; 2455 $parts[] = $wp_rewrite->pagination_base; 2456 $parts[] = $pagenum; 2457 } 2458 2459 $result = user_trailingslashit( implode( '/', array_filter( $parts ) ), 'paged' ); 2460 if ( ! empty( $query_string ) ) { 2461 $result .= $query_string; 2462 } 2456 2463 } 2457 2464 -
trunk/tests/phpunit/tests/link.php
r52010 r56939 4 4 */ 5 5 class Tests_Link extends WP_UnitTestCase { 6 7 public function get_pagenum_link_cb( $url ) {8 return $url . '/WooHoo';9 }10 11 /**12 * @ticket 884713 */14 public function test_get_pagenum_link_case_insensitivity() {15 $old_req_uri = $_SERVER['REQUEST_URI'];16 17 $this->set_permalink_structure( '/%year%/%monthnum%/%day%/%postname%/' );18 19 add_filter( 'home_url', array( $this, 'get_pagenum_link_cb' ) );20 $_SERVER['REQUEST_URI'] = '/woohoo';21 $paged = get_pagenum_link( 2 );22 23 remove_filter( 'home_url', array( $this, 'get_pagenum_link_cb' ) );24 $this->assertSame( $paged, home_url( '/WooHoo/page/2/' ) );25 26 $_SERVER['REQUEST_URI'] = $old_req_uri;27 }28 6 29 7 public function test_wp_get_shortlink() {
Note: See TracChangeset
for help on using the changeset viewer.