Make WordPress Core

Ticket #60059: 60059.diff

File 60059.diff, 1.2 KB (added by david.binda, 2 years ago)
  • src/wp-includes/canonical.php

     
    316316                                        $redirect['query'] = remove_query_arg( 'year', $redirect['query'] );
    317317                                }
    318318                        }
    319                 } elseif ( is_author() && ! empty( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
     319                } elseif ( is_author() && ! empty( $_GET['author'] ) && is_string( $_GET['author'] ) && preg_match( '|^[0-9]+$|', $_GET['author'] ) ) {
    320320                        $author = get_userdata( get_query_var( 'author' ) );
    321321
    322322                        if ( false !== $author
  • tests/phpunit/tests/canonical.php

     
    206206                        array( '/?author=%d', '/author/canonical-author/' ),
    207207                        // array( '/?author=%d&year=2008', '/2008/?author=3'),
    208208                        // array( '/author/canonical-author/?year=2008', '/2008/?author=3'), // Either or, see previous testcase.
     209                        array( '/author/canonical-author/?author[1]=hello', '/author/canonical-author/?author[1]=hello' ),
    209210
    210211                        // Feeds.
    211212                        array( '/?feed=atom', '/feed/atom/' ),