Make WordPress Core


Ignore:
Timestamp:
09/10/2015 06:56:56 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.2 branch.

Props dustinbolton, pento.

See #33470.

File:
1 edited

Legend:

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

    r33476 r33992  
    28362836                . '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?'
    28372837                . '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?'
    2838                 . ')\s+((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
     2838                . ')\s+((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
    28392839            return str_replace( '`', '', $maybe[1] );
    28402840        }
     
    28442844                . 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    28452845                . '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    2846                 . ')\W((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
     2846                . ')\W((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
    28472847            return str_replace( '`', '', $maybe[1] );
    28482848        }
     
    28632863                . '|(?:GRANT|REVOKE).*ON\s+TABLE'
    28642864                . '|SHOW\s+(?:.*FROM|.*TABLE)'
    2865                 . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
     2865                . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
    28662866            return str_replace( '`', '', $maybe[1] );
    28672867        }
Note: See TracChangeset for help on using the changeset viewer.