mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 15:08:10 +01:00
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
This commit is contained in:
parent
43077a6ef8
commit
4ee0da1798
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
@ -2868,11 +2868,8 @@ class wpdb {
|
|||||||
// Allow (select...) union [...] style queries. Use the first query's table name.
|
// Allow (select...) union [...] style queries. Use the first query's table name.
|
||||||
$query = ltrim( $query, "\r\n\t (" );
|
$query = ltrim( $query, "\r\n\t (" );
|
||||||
|
|
||||||
/*
|
// Strip everything between parentheses except nested selects.
|
||||||
* Strip everything between parentheses except nested selects and use only 1,000
|
$query = preg_replace( '/\((?!\s*select)[^(]*?\)/is', '()', $query );
|
||||||
* chars of the query.
|
|
||||||
*/
|
|
||||||
$query = preg_replace( '/\((?!\s*select)[^(]*?\)/is', '()', substr( $query, 0, 1000 ) );
|
|
||||||
|
|
||||||
// Quickly match most common queries.
|
// Quickly match most common queries.
|
||||||
if ( preg_match( '/^\s*(?:'
|
if ( preg_match( '/^\s*(?:'
|
||||||
|
Loading…
Reference in New Issue
Block a user