Make WordPress Core

Ticket #17737: 44652.diff

File 44652.diff, 996 bytes (added by arcturusink, 6 years ago)
  • src/wp-includes/class-wp-query.php

     
    751751                $qv['paged']    = absint( $qv['paged'] );
    752752                $qv['cat']      = preg_replace( '|[^0-9,-]|', '', $qv['cat'] ); // comma separated list of positive or negative integers
    753753                $qv['author']   = preg_replace( '|[^0-9,-]|', '', $qv['author'] ); // comma separated list of positive or negative integers
    754                 $qv['pagename'] = trim( $qv['pagename'] );
    755                 $qv['name']     = trim( $qv['name'] );
    756                 $qv['title']    = trim( $qv['title'] );
     754                $qv['pagename'] = is_string( $qv['pagename'] ) ? trim( $qv['pagename'] )  : '';
     755                $qv['name']     = is_string( $qv['name']     ) ? trim( $qv['name'] )     : '';
     756                $qv['title']    = is_string( $qv['title']    ) ? trim( $qv['title'] )    : '';
    757757                if ( '' !== $qv['hour'] ) {
    758758                        $qv['hour'] = absint( $qv['hour'] );
    759759                }