Make WordPress Core


Ignore:
Timestamp:
03/02/2021 03:14:09 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Security, Site Health: Do not store HTTPS request error messages in an option.

This changes the logic in update_https_detection_errors() to never store error messages from the actual request since they could use a different encoding, which would make storing them in an option potentially fail, leading WordPress to then falsely assume that HTTPS is supported.

While this doesn't actually fix the encoding issue, it is not crucial to do so anyway, since these messages are not used anywhere. A simple differentiation between whether the overall HTTPS request or only the SSL verification failed should be sufficient for the purpose of this function.

Props flixos90, tmatsuur, lukecarbis.
Reviewed by flixos90, SergeyBiryukov.
Merges [50471] to the 5.7 branch.
Fixes #52484.

Location:
branches/5.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.7

  • branches/5.7/src/wp-includes/https-detection.php

    r50391 r50472  
    131131        if ( is_wp_error( $unverified_response ) ) {
    132132            $support_errors->add(
    133                 $unverified_response->get_error_code(),
    134                 $unverified_response->get_error_message()
     133                'https_request_failed',
     134                __( 'HTTPS request failed.' )
    135135            );
    136136        } else {
    137137            $support_errors->add(
    138138                'ssl_verification_failed',
    139                 $response->get_error_message()
     139                __( 'SSL verification failed.' )
    140140            );
    141141        }
Note: See TracChangeset for help on using the changeset viewer.