Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter Mr幺幺肆

    (@mryys)

    研究出了临时的修复方法

    代码原文

    if($update){
    $plugin = get_plugin_data(WP_PLUGIN_DIR.'/'.$file);
    $key = version_compare($update['new_version'], $plugin['Version'], '>') ? 'response' : 'no_update';

    $updates->$key[$file] = (object)(isset($updates->$key[$file]) ? array_merge((array)$updates->$key[$file], $update) : $update);
    }

    修改为

    if(is_array($update) && isset($update['new_version'])){
    $plugin = get_plugin_data(WP_PLUGIN_DIR.'/'.$file);
    $key = version_compare($update['new_version'], $plugin['Version'], '>') ? 'response' : 'no_update';

    if(!isset($updates->$key) || !is_array($updates->$key)){
    $updates->$key = [];
    }

    $updates->$key[$file] = (object)(isset($updates->$key[$file]) ? array_merge((array)$updates->$key[$file], $update) : $update);
    }
Viewing 1 replies (of 1 total)