From c03f4cb219febee886a9067aacd9e6ffebddaa60 Mon Sep 17 00:00:00 2001 From: Georg <1309628+Georg-Git@users.noreply.github.com> Date: Tue, 24 Sep 2024 19:56:06 +0200 Subject: [PATCH 1/2] Fix: scraping error text while in normal operation Fix: scraping error text while in normal operation https://core.trac.wordpress.org/ticket/62105 --- src/wp-includes/load.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index b0b8209235c3e..d1fa04143ca3e 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -1806,8 +1806,13 @@ function wp_start_scraping_edited_file_errors() { $key = substr( sanitize_key( wp_unslash( $_REQUEST['wp_scrape_key'] ) ), 0, 32 ); $nonce = wp_unslash( $_REQUEST['wp_scrape_nonce'] ); + $transient = get_transient( 'scrape_key_' . $key ); - if ( get_transient( 'scrape_key_' . $key ) !== $nonce ) { + if ( $transient === false ) { + return; + } + + if ( $transient !== $nonce ) { echo "###### wp_scraping_result_start:$key ######"; echo wp_json_encode( array( From 3c1efb20f5557a80255446c255123c5273978ac0 Mon Sep 17 00:00:00 2001 From: Georg <1309628+Georg-Git@users.noreply.github.com> Date: Tue, 24 Sep 2024 20:09:31 +0200 Subject: [PATCH 2/2] Update src/wp-includes/load.php Co-authored-by: DEBARGHYA BANERJEE <93442804+Debarghya-Banerjee@users.noreply.github.com> --- src/wp-includes/load.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php index d1fa04143ca3e..2391e3a77521c 100644 --- a/src/wp-includes/load.php +++ b/src/wp-includes/load.php @@ -1808,7 +1808,7 @@ function wp_start_scraping_edited_file_errors() { $nonce = wp_unslash( $_REQUEST['wp_scrape_nonce'] ); $transient = get_transient( 'scrape_key_' . $key ); - if ( $transient === false ) { + if ( false === $transient ) { return; }