Make WordPress Core

Changeset 29912


Ignore:
Timestamp:
10/16/2014 03:31:27 AM (10 years ago)
Author:
boonebgorges
Message:

Check that search value is scalar before parsing.

Prevents PHP notices when non-scalar values are passed.

Includes unit tests.

Props tivnet.
Fixes #29736.

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r29891 r29912  
    15751575
    15761576        // Fairly insane upper bound for search string lengths.
    1577         if ( ! empty( $qv['s'] ) && strlen( $qv['s'] ) > 1600 )
     1577        if ( ! is_scalar( $qv['s'] ) || ( ! empty( $qv['s'] ) && strlen( $qv['s'] ) > 1600 ) ) {
    15781578            $qv['s'] = '';
     1579        }
    15791580
    15801581        // Compat. Map subpost to attachment.
Note: See TracChangeset for help on using the changeset viewer.