WPDB: `get_table_from_query()` didn't find table names with hyphens in them.
Merge of [33718] to the 4.0 branch. Props dustinbolton, pento. See #33470. Built from https://develop.svn.wordpress.org/branches/4.0@33994 git-svn-id: http://core.svn.wordpress.org/branches/4.0@33963 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4379874534
commit
21c8cc7e5a
|
@ -2821,7 +2821,7 @@ class wpdb {
|
||||||
. '|REPLACE(?:\s+LOW_PRIORITY|\s+DELAYED)?(?:\s+INTO)?'
|
. '|REPLACE(?:\s+LOW_PRIORITY|\s+DELAYED)?(?:\s+INTO)?'
|
||||||
. '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?'
|
. '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?'
|
||||||
. '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?'
|
. '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?'
|
||||||
. ')\s+((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
|
. ')\s+((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
|
||||||
return str_replace( '`', '', $maybe[1] );
|
return str_replace( '`', '', $maybe[1] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2829,7 +2829,7 @@ class wpdb {
|
||||||
if ( preg_match( '/^\s*(?:'
|
if ( preg_match( '/^\s*(?:'
|
||||||
. 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
|
. 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
|
||||||
. '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
|
. '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
|
||||||
. ')\W((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
|
. ')\W((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
|
||||||
return str_replace( '`', '', $maybe[1] );
|
return str_replace( '`', '', $maybe[1] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2848,7 +2848,7 @@ class wpdb {
|
||||||
. '|LOAD\s+DATA.*INFILE.*INTO\s+TABLE'
|
. '|LOAD\s+DATA.*INFILE.*INTO\s+TABLE'
|
||||||
. '|(?:GRANT|REVOKE).*ON\s+TABLE'
|
. '|(?:GRANT|REVOKE).*ON\s+TABLE'
|
||||||
. '|SHOW\s+(?:.*FROM|.*TABLE)'
|
. '|SHOW\s+(?:.*FROM|.*TABLE)'
|
||||||
. ')\s+\(*\s*((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
|
. ')\s+\(*\s*((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
|
||||||
return str_replace( '`', '', $maybe[1] );
|
return str_replace( '`', '', $maybe[1] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue