Changeset 61001
- Timestamp:
- 10/21/2025 02:48:53 AM (4 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/update.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/update.php
r60493 r61001 107 107 'multisite_enabled' => $multisite_enabled, 108 108 'initial_db_version' => get_site_option( 'initial_db_version' ), 109 'myisam_tables' => array(), 109 110 'extensions' => array_combine( $extensions, array_map( 'phpversion', $extensions ) ), 110 111 'platform_flags' => array( … … 114 115 'image_support' => array(), 115 116 ); 117 118 // Check for default tables using the MyISAM engine. 119 $table_names = implode( "','", $wpdb->tables() ); 120 $myisam_tables = $wpdb->get_results( 121 $wpdb->prepare( 122 // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- This query cannot use interpolation. 123 "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = %s AND TABLE_NAME IN ('$table_names') AND ENGINE = %s;", 124 DB_NAME, 125 'MyISAM' 126 ), 127 OBJECT_K 128 ); 129 130 if ( ! empty( $myisam_tables ) ) { 131 $all_unprefixed_tables = $wpdb->tables( 'all', false ); 132 133 // Including the table prefix is not necessary. 134 $unprefixed_myisam_tables = array_reduce( 135 array_keys( $myisam_tables ), 136 function ( $carry, $prefixed_myisam_table ) use ( $all_unprefixed_tables ) { 137 foreach ( $all_unprefixed_tables as $unprefixed ) { 138 if ( str_ends_with( $prefixed_myisam_table, $unprefixed ) ) { 139 $carry[] = $unprefixed; 140 break; 141 } 142 } 143 return $carry; 144 }, 145 array() 146 ); 147 148 $query['myisam_tables'] = $unprefixed_myisam_tables; 149 } 116 150 117 151 if ( function_exists( 'gd_info' ) ) {
Note: See TracChangeset
for help on using the changeset viewer.