mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Canonical: Check if the author parameter is a string in redirect_canonical().
This avoids a PHP warning or error when viewing an author on the front end, while an array is passed as `$_GET['author']`. Follow-up to [12034], [12040], [12202]. Props david.binda, antonvlasenko, azaozz, SergeyBiryukov. Fixes #60059. git-svn-id: https://develop.svn.wordpress.org/trunk@57232 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -316,7 +316,9 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) {
|
||||
$redirect['query'] = remove_query_arg( 'year', $redirect['query'] );
|
||||
}
|
||||
}
|
||||
} elseif ( is_author() && ! empty( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
|
||||
} elseif ( is_author() && ! empty( $_GET['author'] )
|
||||
&& is_string( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] )
|
||||
) {
|
||||
$author = get_userdata( get_query_var( 'author' ) );
|
||||
|
||||
if ( false !== $author
|
||||
|
||||
Reference in New Issue
Block a user