Skip to content

Commit 7c39b41

Browse files
committed
Remove table prefixes before sending to .org
1 parent 6092a4b commit 7c39b41

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/wp-includes/update.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,24 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
129129

130130
// Only report when a site has MyISAM tables to save bytes.
131131
if ( ! empty( $myisam_tables ) ) {
132-
$query['myisam_tables'] = array_keys( $myisam_tables );
132+
$all_unprefixed_tables = $wpdb->tables( 'all', false );
133+
134+
// Including the table prefix is not necessary.
135+
$unprefixed_myisam_tables = array_reduce(
136+
array_keys( $myisam_tables ),
137+
function( $carry, $prefixed_myisam_table ) use ( $all_unprefixed_tables ) {
138+
foreach ( $all_unprefixed_tables as $unprefixed ) {
139+
if ( str_ends_with( $prefixed_myisam_table, $unprefixed ) ) {
140+
$carry[] = $unprefixed;
141+
break;
142+
}
143+
}
144+
return $carry;
145+
},
146+
array()
147+
);
148+
149+
$query['myisam_tables'] = $unprefixed_myisam_tables;
133150
}
134151

135152
if ( function_exists( 'gd_info' ) ) {

0 commit comments

Comments
 (0)