Changeset 30699 for trunk/src/wp-includes/wp-db.php
- Timestamp:
- 12/02/2014 02:59:36 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r30677 r30699 2165 2165 */ 2166 2166 protected function get_table_charset( $table ) { 2167 $table = strtolower( $table );2167 $tablekey = strtolower( $table ); 2168 2168 2169 2169 /** … … 2183 2183 } 2184 2184 2185 if ( isset( $this->table_charset[ $table ] ) ) {2186 return $this->table_charset[ $table ];2185 if ( isset( $this->table_charset[ $tablekey ] ) ) { 2186 return $this->table_charset[ $tablekey ]; 2187 2187 } 2188 2188 … … 2197 2197 } 2198 2198 2199 $this->col_meta[ $table ] = $columns;2199 $this->col_meta[ $tablekey ] = $columns; 2200 2200 2201 2201 foreach ( $columns as $column ) { … … 2209 2209 // A binary/blob means the whole query gets treated like this. 2210 2210 if ( in_array( strtoupper( $type ), array( 'BINARY', 'VARBINARY', 'TINYBLOB', 'MEDIUMBLOB', 'BLOB', 'LONGBLOB' ) ) ) { 2211 $this->table_charset[ $table ] = 'binary';2211 $this->table_charset[ $tablekey ] = 'binary'; 2212 2212 return 'binary'; 2213 2213 } … … 2243 2243 } 2244 2244 2245 $this->table_charset[ $table ] = $charset;2245 $this->table_charset[ $tablekey ] = $charset; 2246 2246 return $charset; 2247 2247 } … … 2259 2259 */ 2260 2260 protected function get_col_charset( $table, $column ) { 2261 $table = strtolower( $table );2262 $column = strtolower( $column );2261 $tablekey = strtolower( $table ); 2262 $columnkey = strtolower( $column ); 2263 2263 2264 2264 /** … … 2284 2284 } 2285 2285 2286 if ( empty( $this->table_charset[ $table ] ) ) {2286 if ( empty( $this->table_charset[ $tablekey ] ) ) { 2287 2287 // This primes column information for us. 2288 2288 $table_charset = $this->get_table_charset( $table ); … … 2293 2293 2294 2294 // If still no column information, return the table charset. 2295 if ( empty( $this->col_meta[ $table ] ) ) {2296 return $this->table_charset[ $table ];2295 if ( empty( $this->col_meta[ $tablekey ] ) ) { 2296 return $this->table_charset[ $tablekey ]; 2297 2297 } 2298 2298 2299 2299 // If this column doesn't exist, return the table charset. 2300 if ( empty( $this->col_meta[ $table ][ $column] ) ) {2301 return $this->table_charset[ $table ];2300 if ( empty( $this->col_meta[ $tablekey ][ $columnkey ] ) ) { 2301 return $this->table_charset[ $tablekey ]; 2302 2302 } 2303 2303 2304 2304 // Return false when it's not a string column. 2305 if ( empty( $this->col_meta[ $table ][ $column]->Collation ) ) {2305 if ( empty( $this->col_meta[ $tablekey ][ $columnkey ]->Collation ) ) { 2306 2306 return false; 2307 2307 } 2308 2308 2309 list( $charset ) = explode( '_', $this->col_meta[ $table ][ $column]->Collation );2309 list( $charset ) = explode( '_', $this->col_meta[ $tablekey ][ $columnkey ]->Collation ); 2310 2310 return $charset; 2311 2311 }
Note: See TracChangeset
for help on using the changeset viewer.