From c43baf9ef455dffd87f541438434f115e43bcc3b Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 14 Jul 2015 10:21:26 +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. Merges [33259] to the 4.2 branch. Fixes #32763 Built from https://develop.svn.wordpress.org/branches/4.2@33260 git-svn-id: http://core.svn.wordpress.org/branches/4.2@33232 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/wp-db.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index f2b1bc5996..83287a8606 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -2833,11 +2833,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*(?:'