Make WordPress Core


Ignore:
Timestamp:
09/10/2015 07:13:02 AM (11 years ago)
Author:
pento
Message:

WPDB: get_table_from_query() didn't find table names with hyphens in them.

Merge of [33718] to the 3.8 branch.

Props dustinbolton, pento.

See #33470.

File:
1 edited

Legend:

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

    r32415 r33996  
    24092409                                . '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?'
    24102410                                . '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?'
    2411                                 . ')\s+((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
     2411                                . ')\s+((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
    24122412                        return str_replace( '`', '', $maybe[1] );
    24132413                }
    … …  
    24172417                                . 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    24182418                                . '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    2419                                 . ')\W((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
     2419                                . ')\W((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
    24202420                        return str_replace( '`', '', $maybe[1] );
    24212421                }
    … …  
    24362436                                . '|(?:GRANT|REVOKE).*ON\s+TABLE'
    24372437                                . '|SHOW\s+(?:.*FROM|.*TABLE)'
    2438                                 . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
     2438                                . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
    24392439                        return str_replace( '`', '', $maybe[1] );
    24402440                }
Note: See TracChangeset for help on using the changeset viewer.