From 14709908921cd0db38803b9d1bf6a7bb399d41be Mon Sep 17 00:00:00 2001 From: Boone Gorges Date: Thu, 16 Oct 2014 03:32:20 +0000 Subject: [PATCH] Check that search value is scalar before parsing. Prevents PHP notices when non-scalar values are passed. Includes unit tests. Props tivnet. Fixes #29736. Built from https://develop.svn.wordpress.org/trunk@29912 git-svn-id: http://core.svn.wordpress.org/trunk@29666 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 54f30873a6..1334272911 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1574,8 +1574,9 @@ class WP_Query { if ( '' !== $qv['menu_order'] ) $qv['menu_order'] = absint($qv['menu_order']); // Fairly insane upper bound for search string lengths. - if ( ! empty( $qv['s'] ) && strlen( $qv['s'] ) > 1600 ) + if ( ! is_scalar( $qv['s'] ) || ( ! empty( $qv['s'] ) && strlen( $qv['s'] ) > 1600 ) ) { $qv['s'] = ''; + } // Compat. Map subpost to attachment. if ( '' != $qv['subpost'] )