Skip to content

Commit

Permalink
WPCS
Browse files Browse the repository at this point in the history
  • Loading branch information
afragen committed Mar 9, 2024
1 parent 7b1c7aa commit 24f4611
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/wp-admin/includes/class-wp-automatic-updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -1709,10 +1709,11 @@ protected function has_fatal_error() {

( new WP_Upgrader() )->maintenance_mode( false ); // TODO: remove for PR.

$scrape_key = md5( $upgrading );
$scrape_nonce = (string) $upgrading;
$transient = 'scrape_key_' . $scrape_key;
set_transient($transient, $scrape_nonce, 30);
$scrape_key = md5( $upgrading );
$scrape_nonce = (string) $upgrading;
$cookies = wp_unslash( $_COOKIE );
$transient = 'scrape_key_' . $scrape_key;
set_transient( $transient, $scrape_nonce, 30 );

$scrape_params = array(
'wp_scrape_key' => $scrape_key,
Expand All @@ -1738,7 +1739,7 @@ protected function has_fatal_error() {
$needle_start = "###### wp_scraping_result_start:$scrape_key ######";
$needle_end = "###### wp_scraping_result_end:$scrape_key ######";
$url = add_query_arg( $scrape_params, home_url( '/' ) );
$response = wp_remote_get( $url, compact( 'headers', 'timeout', 'sslverify' ) );
$response = wp_remote_get( $url, compact( 'cookies', 'headers', 'timeout', 'sslverify' ) );

// If this outputs `true` in the log, it means there were no fatal errors detected.
error_log( var_export( substr( $response['body'], strpos( $response['body'], '###### wp_scraping_result_start:' ) ), true ) );
Expand Down

0 comments on commit 24f4611

Please sign in to comment.