WordPress.org

Make WordPress Core


Ignore:
Timestamp:
08/24/2015 12:18:49 AM (6 years ago)
Author:
pento
Message:

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

Props dustinbolton for the fix.

Fixes #33470.

File:
1 edited

Legend:

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

    r33701 r33718  
    28712871                . '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?'
    28722872                . '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?'
    2873                 . ')\s+((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
     2873                . ')\s+((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
    28742874            return str_replace( '`', '', $maybe[1] );
    28752875        }
     
    28792879                . 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    28802880                . '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    2881                 . ')\W((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
     2881                . ')\W((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
    28822882            return str_replace( '`', '', $maybe[1] );
    28832883        }
     
    28982898                . '|(?:GRANT|REVOKE).*ON\s+TABLE'
    28992899                . '|SHOW\s+(?:.*FROM|.*TABLE)'
    2900                 . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
     2900                . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
    29012901            return str_replace( '`', '', $maybe[1] );
    29022902        }
Note: See TracChangeset for help on using the changeset viewer.