Make WordPress Core


Ignore:
Timestamp:
09/10/2015 07:08:35 AM (6 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.9 branch.

Props dustinbolton, pento.

See #33470.

File:
1 edited

Legend:

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

    r32414 r33995  
    27862786                . '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?'
    27872787                . '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?'
    2788                 . ')\s+((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
     2788                . ')\s+((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)/is', $query, $maybe ) ) {
    27892789            return str_replace( '`', '', $maybe[1] );
    27902790        }
     
    27942794                . 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    27952795                . '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)'
    2796                 . ')\W((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
     2796                . ')\W((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) {
    27972797            return str_replace( '`', '', $maybe[1] );
    27982798        }
     
    28132813                . '|(?:GRANT|REVOKE).*ON\s+TABLE'
    28142814                . '|SHOW\s+(?:.*FROM|.*TABLE)'
    2815                 . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
     2815                . ')\s+\(*\s*((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\s*\)*/is', $query, $maybe ) ) {
    28162816            return str_replace( '`', '', $maybe[1] );
    28172817        }
Note: See TracChangeset for help on using the changeset viewer.