Ticket #11804: 11804.patch

File 11804.patch, 1.6 KB (added by hakre, 3 years ago)

The actual patch.

  • wp-admin/maint/repair.php

     
    3131 
    3232        $okay = true; 
    3333 
    34         // Loop over the WP tables, checking and repairing as needed. 
    35         foreach ($wpdb->tables as $table) { 
    36                 if ( in_array($table, $wpdb->old_tables) ) 
    37                         continue; 
     34        // Loop over the WP tables, checking and repairing as needed.    
     35        foreach ($wpdb->get_tables() as $table) { 
    3836 
    3937                $check = $wpdb->get_row("CHECK TABLE {$wpdb->prefix}$table"); 
    4038                if ( 'OK' == $check->Msg_text ) { 
  • wp-includes/wp-db.php

     
    11291129        function db_version() { 
    11301130                return preg_replace('/[^0-9.].*/', '', mysql_get_server_info( $this->dbh )); 
    11311131        } 
     1132         
     1133        /** 
     1134         * get tables 
     1135         *  
     1136         * get list of a set of tables 
     1137         *  
     1138         * Sets: 
     1139         *  
     1140         *   all     : all names 
     1141         *   current : active tables 
     1142         *   old     : deprecated tables  
     1143         *  
     1144         *  
     1145         * @param  string $set (optional) 'all', 'current' or 'old'. defaults to 'current' 
     1146         * @return array  list of old table names (w/o prefix), false on error 
     1147         */ 
     1148        function get_tables( $set = 'current' ) { 
     1149                $tables = false; 
     1150                 
     1151                switch ( $set ) { 
     1152                        case 'all': 
     1153                                $tables = $this->tables; 
     1154                                break;                           
     1155                        case 'current': 
     1156                                $tables = array_diff( $this->tables, $this->old_tables ); 
     1157                                break;                           
     1158                        case 'old': 
     1159                                $tables = $this->old_tables; 
     1160                                break; 
     1161                } 
     1162 
     1163                return $tables; 
     1164        } 
    11321165} 
    11331166 
    11341167if ( ! isset($wpdb) ) {