WordPress.org

Make WordPress Core

Ticket #11639: 11639-testing-only.diff

File 11639-testing-only.diff, 1.3 KB (added by nacin, 6 years ago)

For testing only: Prevents the downloaded update-core.php from being copied over the patched update-core.php. Also in here is code to force wpdb::db_version to report < 4.1.2

  • wp-admin/includes/class-wp-upgrader.php

     
    781781                if ( is_wp_error($working_dir) ) 
    782782                        return $working_dir; 
    783783 
    784                 // Copy update-core.php from the new version into place. 
    785                 if ( !$wp_filesystem->copy($working_dir . '/wordpress/wp-admin/includes/update-core.php', $wp_dir . 'wp-admin/includes/update-core.php', true) ) { 
    786                         $wp_filesystem->delete($working_dir, true); 
    787                         return new WP_Error('copy_failed', $this->strings['copy_failed']); 
    788                 } 
    789                 $wp_filesystem->chmod($wp_dir . 'wp-admin/includes/update-core.php', FS_CHMOD_FILE); 
    790  
     784                $wp_filesystem->delete($working_dir . '/wordpress/wp-admin/includes/update-core.php'); 
    791785                require(ABSPATH . 'wp-admin/includes/update-core.php'); 
    792786 
    793787                return update_core($working_dir, $wp_dir); 
  • wp-includes/wp-db.php

     
    11271127         * @return false|string false on failure, version number on success 
    11281128         */ 
    11291129        function db_version() { 
     1130                return '4.1.1'; 
    11301131                return preg_replace('/[^0-9.].*/', '', mysql_get_server_info( $this->dbh )); 
    11311132        } 
    11321133}