Ticket #38751: 38751.diff
File 38751.diff, 1.3 KB (added by , 8 years ago) |
---|
-
trunk/wp-includes/wp-db.php
3037 3037 return str_replace( '`', '', $maybe[1] ); 3038 3038 } 3039 3039 3040 // SHOW TABLE STATUS and SHOW TABLES 3041 if ( preg_match( '/^\s*(?:' 3042 . 'SHOW\s+TABLE\s+STATUS.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)' 3043 . '|SHOW\s+(?:FULL\s+)?TABLES.+(?:LIKE\s+|WHERE\s+Name\s*=\s*)' 3044 . ')\W((?:[0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)\W/is', $query, $maybe ) ) { 3045 return str_replace( '`', '', $maybe[1] ); 3040 // SHOW TABLE STATUS and SHOW TABLES WHERE Name = 'wp_posts' 3041 if ( preg_match( '/^\s*SHOW\s+(?:TABLE\s+STATUS|(?:FULL\s+)?TABLES).+WHERE\s+Name\s*=\s*("|\')((?:[0-9a-zA-Z$_.-]|[\xC2-\xDF][\x80-\xBF])+)\\1/is', $query, $maybe ) ) { 3042 return $maybe[2]; 3046 3043 } 3047 3044 3045 // SHOW TABLE STATUS LIKE and SHOW TABLES LIKE 'wp\_123\_%' 3046 if ( preg_match( '/^\s*SHOW\s+(?:TABLE\s+STATUS|(?:FULL\s+)?TABLES)\s+(?:WHERE\s+Name\s+)?LIKE\s*("|\')((?:[\\\\0-9a-zA-Z$_.`-]|[\xC2-\xDF][\x80-\xBF])+)%?\\1/is', $query, $maybe ) ) { 3047 return str_replace( '\\_', '_', $maybe[2] ); 3048 } 3049 3048 3050 // Big pattern for the rest of the table-related queries. 3049 3051 if ( preg_match( '/^\s*(?:' 3050 3052 . '(?:EXPLAIN\s+(?:EXTENDED\s+)?)?SELECT.*?\s+FROM'