WordPress.org

Make WordPress Core

Ticket #16158: garyc40.16158.diff

File garyc40.16158.diff, 470 bytes (added by garyc40, 4 years ago)

validate content-type of response

  • wp-includes/update.php

    diff --git wp-includes/update.php wp-includes/update.php
    index 1f9f2a9..7217242 100644
    function wp_version_check() { 
    7676        if ( 200 != $response['response']['code'] ) 
    7777                return false; 
    7878 
     79        if ( 'text/plain; charset=utf-8' != $response['headers']['content-type'] ) 
     80                return false; 
     81 
    7982        $body = trim( $response['body'] ); 
    8083        $body = str_replace(array("\r\n", "\r"), "\n", $body); 
    8184        $new_options = array();