Ticket #14273: 14273.diff
| File 14273.diff, 1.2 KB (added by , 12 years ago) |
|---|
-
src/wp-admin/install-helper.php
50 50 * @param string $create_ddl Create database table SQL. 51 51 * @return bool False on error, true if already exists or success. 52 52 */ 53 function maybe_create_table( $table_name, $create_ddl) {53 function maybe_create_table( $table_name, $create_ddl ) { 54 54 global $wpdb; 55 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { 56 if ($table == $table_name) {57 return true;58 }55 56 $query = $wpdb->prepare( "SHOW TABLES LIKE %s", $table_name ); 57 if ( strtolower( $wpdb->get_var( $query ) ) === strtolower( $table_name ) ) { 58 return true; 59 59 } 60 // Didn't find it, so try to create it.61 $wpdb->query($create_ddl);62 60 61 // Didn't find it, so we need to try to create it. 62 $wpdb->query( $create_ddl ); 63 63 64 // We cannot directly tell that whether this succeeded! 64 foreach ($wpdb->get_col("SHOW TABLES",0) as $table ) { 65 if ($table == $table_name) { 66 return true; 67 } 68 } 69 return false; 65 return ( strtolower( $wpdb->get_var( $query ) ) === strtolower( $table_name ) ); 70 66 } 71 67 endif; 72 68
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)