Make WordPress Core


Ignore:
Timestamp:
09/10/2015 07:04:04 AM (9 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0/src/wp-includes/wp-db.php

    r32413 r33994  
    28222822                . '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?'
    28232823                . '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?'
    2824                 . ')\s+((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
     2824                . ')\s+((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
    28252825            return str_replace( '`', '', $maybe[1] );
    28262826        }
     
    28302830                . 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    28312831                . '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    2832                 . ')\W((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
     2832                . ')\W((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
    28332833            return str_replace( '`', '', $maybe[1] );
    28342834        }
     
    28492849                . '|(?:GRANT|REVOKE).*ON\s+TABLE'
    28502850                . '|SHOW\s+(?:.*FROM|.*TABLE)'
    2851                 . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
     2851                . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
    28522852            return str_replace( '`', '', $maybe[1] );
    28532853        }
Note: See TracChangeset for help on using the changeset viewer.