wip
This commit is contained in:
@@ -77,18 +77,18 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Notice fixing.
|
||||
$original += array(
|
||||
'host' => '',
|
||||
'path' => '',
|
||||
'query' => '',
|
||||
'scheme' => '',
|
||||
);
|
||||
|
||||
$redirect = $original;
|
||||
$redirect_url = false;
|
||||
$redirect_obj = false;
|
||||
|
||||
// Notice fixing.
|
||||
if ( ! isset( $redirect['path'] ) ) {
|
||||
$redirect['path'] = '';
|
||||
}
|
||||
if ( ! isset( $redirect['query'] ) ) {
|
||||
$redirect['query'] = '';
|
||||
}
|
||||
|
||||
/*
|
||||
* If the original URL ended with non-breaking spaces, they were almost
|
||||
* certainly inserted by accident. Let's remove them, so the reader doesn't
|
||||
@@ -615,6 +615,14 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
|
||||
unset( $redirect['port'] );
|
||||
}
|
||||
|
||||
// Notice prevention after new parse_url( $redirect_url ) calls
|
||||
$redirect += array(
|
||||
'host' => '',
|
||||
'path' => '',
|
||||
'query' => '',
|
||||
'scheme' => '',
|
||||
);
|
||||
|
||||
// Trailing /index.php.
|
||||
$redirect['path'] = preg_replace( '|/' . preg_quote( $wp_rewrite->index, '|' ) . '/*?$|', '/', $redirect['path'] );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user