@@ 464-471 (lines=8) @@ | ||
461 | if ( !empty( $redirect['query'] ) ) |
|
462 | $compare_redirect[] = $redirect['query']; |
|
463 | ||
464 | if ( $compare_original !== $compare_redirect ) { |
|
465 | $redirect_url = $redirect['scheme'] . '://' . $redirect['host']; |
|
466 | if ( !empty($redirect['port']) ) |
|
467 | $redirect_url .= ':' . $redirect['port']; |
|
468 | $redirect_url .= $redirect['path']; |
|
469 | if ( !empty($redirect['query']) ) |
|
470 | $redirect_url .= '?' . $redirect['query']; |
|
471 | } |
|
472 | ||
473 | if ( ! $redirect_url || $redirect_url == $requested_url ) { |
|
474 | return; |
|
@@ 564-574 (lines=11) @@ | ||
561 | */ |
|
562 | function strip_fragment_from_url( $url ) { |
|
563 | $parsed_url = @parse_url( $url ); |
|
564 | if ( ! empty( $parsed_url['host'] ) ) { |
|
565 | // This mirrors code in redirect_canonical(). It does not handle every case. |
|
566 | $url = $parsed_url['scheme'] . '://' . $parsed_url['host']; |
|
567 | if ( ! empty( $parsed_url['port'] ) ) { |
|
568 | $url .= ':' . $parsed_url['port']; |
|
569 | } |
|
570 | $url .= $parsed_url['path']; |
|
571 | if ( ! empty( $parsed_url['query'] ) ) { |
|
572 | $url .= '?' . $parsed_url['query']; |
|
573 | } |
|
574 | } |
|
575 | ||
576 | return $url; |
|
577 | } |