diff --git wp-includes/wp-db.php wp-includes/wp-db.php
index 0bd7a18..2bf27f7 100644
|
|
class wpdb { |
2274 | 2274 | return $this->table_charset[ $tablekey ]; |
2275 | 2275 | } |
2276 | 2276 | |
2277 | | $charsets = $columns = array(); |
2278 | | $results = $this->get_results( "SHOW FULL COLUMNS FROM `$table`" ); |
| 2277 | $charsets = $columns = array(); |
| 2278 | $table_parts = explode('.', $table); |
| 2279 | $table_parts = array_map(function($var) { return "`".$var."`"; },$table_parts); |
| 2280 | $table = implode(".",$table_parts); |
| 2281 | |
| 2282 | $results = $this->get_results( "SHOW FULL COLUMNS FROM $table" ); |
2279 | 2283 | if ( ! $results ) { |
2280 | 2284 | return new WP_Error( 'wpdb_get_table_charset_failure' ); |
2281 | 2285 | } |
… |
… |
class wpdb { |
2799 | 2803 | $query = preg_replace( '/\((?!\s*select)[^(]*?\)/is', '()', substr( $query, 0, 1000 ) ); |
2800 | 2804 | |
2801 | 2805 | // Quickly match most common queries. |
2802 | | if ( preg_match( '/^\s*(?:' |
| 2806 | if ( preg_match( '/(*UTF8)^\s*(?:' |
2803 | 2807 | . 'SELECT.*?\s+FROM' |
2804 | 2808 | . '|INSERT(?:\s+LOW_PRIORITY|\s+DELAYED|\s+HIGH_PRIORITY)?(?:\s+IGNORE)?(?:\s+INTO)?' |
2805 | 2809 | . '|REPLACE(?:\s+LOW_PRIORITY|\s+DELAYED)?(?:\s+INTO)?' |
2806 | 2810 | . '|UPDATE(?:\s+LOW_PRIORITY)?(?:\s+IGNORE)?' |
2807 | 2811 | . '|DELETE(?:\s+LOW_PRIORITY|\s+QUICK|\s+IGNORE)*(?:\s+FROM)?' |
2808 | | . ')\s+`?([\w-]+)`?/is', $query, $maybe ) ) { |
| 2812 | . ')\s+`?([[:alnum:]-._$]+)`?/uis', $query, $maybe ) ) { |
2809 | 2813 | return $maybe[1]; |
2810 | 2814 | } |
2811 | 2815 | |
2812 | 2816 | // SHOW TABLE STATUS and SHOW TABLES |
2813 | | if ( preg_match( '/^\s*(?:' |
| 2817 | if ( preg_match( '/(*UTF8)^\s*(?:' |
2814 | 2818 | . 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)' |
2815 | 2819 | . '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)' |
2816 | | . ')\W([\w-]+)\W/is', $query, $maybe ) ) { |
| 2820 | . ')\W([[:alnum:]-._$]+)\W/uis', $query, $maybe ) ) { |
2817 | 2821 | return $maybe[1]; |
2818 | 2822 | } |
2819 | 2823 | |
2820 | 2824 | // Big pattern for the rest of the table-related queries. |
2821 | | if ( preg_match( '/^\s*(?:' |
| 2825 | if ( preg_match( '/(*UTF8)^\s*(?:' |
2822 | 2826 | . '(?:EXPLAIN\s+(?:EXTENDED\s+)?)?SELECT.*?\s+FROM' |
2823 | 2827 | . '|DESCRIBE|DESC|EXPLAIN|HANDLER' |
2824 | 2828 | . '|(?:LOCK|UNLOCK)\s+TABLE(?:S)?' |
… |
… |
class wpdb { |
2832 | 2836 | . '|LOAD\s+DATA.*INFILE.*INTO\s+TABLE' |
2833 | 2837 | . '|(?:GRANT|REVOKE).*ON\s+TABLE' |
2834 | 2838 | . '|SHOW\s+(?:.*FROM|.*TABLE)' |
2835 | | . ')\s+\(*\s*`?([\w-]+)`?\s*\)*/is', $query, $maybe ) ) { |
| 2839 | . ')\s+\(*\s*`?([[:alnum:]-._$]+)`?\s*\)*/uis', $query, $maybe ) ) { |
2836 | 2840 | return $maybe[1]; |
2837 | 2841 | } |
2838 | 2842 | |