From 4ee0da1798b9d1c5d6c58ce2db8074623c7ea13d Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 14 Jul 2015 10:19:24 +0000 Subject: [PATCH] WPDB: When extracting the table name from a query, we had a 1000 character limit on the SQL string that would be searched. This was a hangover from when the code was imported from HyperDB, and isn't appropriate for Core, where a wider range of queries are likely to be run. Fixes #32763 Built from https://develop.svn.wordpress.org/trunk@33259 git-svn-id: http://core.svn.wordpress.org/trunk@33231 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-includes/wp-db.php | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index 74a2a7d043..6c15732410 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-beta2-33257'; +$wp_version = '4.3-beta2-33259'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 2f6d4f484c..cbf2abf77f 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -2868,11 +2868,8 @@ class wpdb { // Allow (select...) union [...] style queries. Use the first query's table name. $query = ltrim( $query, "\r\n\t (" ); - /* - * Strip everything between parentheses except nested selects and use only 1,000 - * chars of the query. - */ - $query = preg_replace( '/\((?!\s*select)[^(]*?\)/is', '()', substr( $query, 0, 1000 ) ); + // Strip everything between parentheses except nested selects. + $query = preg_replace( '/\((?!\s*select)[^(]*?\)/is', '()', $query ); // Quickly match most common queries. if ( preg_match( '/^\s*(?:'