Make WordPress Core

Ticket #44118: 44118-after-update-uri-header.diff

File 44118-after-update-uri-header.diff, 1.4 KB (added by siliconforks, 4 years ago)

Refreshed patch to work after r50921 (which added support for the Update URI header)

  • src/wp-includes/update.php

    diff --git a/src/wp-includes/update.php b/src/wp-includes/update.php
    index 79e3b3ea33..c4521427bd 100644
    a b function wp_update_plugins( $extra_stats = array() ) { 
    296296                $current = new stdClass;
    297297        }
    298298
    299         $updates               = new stdClass;
    300         $updates->last_checked = time();
    301         $updates->response     = array();
    302         $updates->translations = array();
    303         $updates->no_update    = array();
    304 
    305299        $doing_cron = wp_doing_cron();
    306300
    307301        // Check for update on a different schedule, depending on the page.
    function wp_update_plugins( $extra_stats = array() ) { 
    330324                $plugin_changed = false;
    331325
    332326                foreach ( $plugins as $file => $p ) {
    333                         $updates->checked[ $file ] = $p['Version'];
    334 
    335327                        if ( ! isset( $current->checked[ $file ] ) || (string) $current->checked[ $file ] !== (string) $p['Version'] ) {
    336328                                $plugin_changed = true;
    337329                        }
    function wp_update_plugins( $extra_stats = array() ) { 
    419411                return;
    420412        }
    421413
     414        $updates               = new stdClass;
     415        $updates->last_checked = time();
     416        $updates->response     = array();
     417        $updates->translations = array();
     418        $updates->no_update    = array();
     419        foreach ( $plugins as $file => $p ) {
     420                $updates->checked[ $file ] = $p['Version'];
     421        }
     422
    422423        $response = json_decode( wp_remote_retrieve_body( $raw_response ), true );
    423424
    424425        if ( $response && is_array( $response ) ) {