Plugins: Check if `_error_nonce` is set before attempting to verify it.

This avoids a PHP notice on the Plugins screen when `error` query string is added to the URL.

Props wponlinesupport.
Fixes #43876.
Built from https://develop.svn.wordpress.org/trunk@49683


git-svn-id: http://core.svn.wordpress.org/trunk@49406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-11-23 13:36:07 +00:00
parent 8312762816
commit 5f9cf0141e
2 changed files with 4 additions and 2 deletions

View File

@ -641,7 +641,9 @@ if ( isset( $_GET['error'] ) ) :
<div id="message" class="error"><p><?php echo $errmsg; ?></p>
<?php
if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin ) ) {
if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] )
&& isset( $_GET['_error_nonce'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin )
) {
$iframe_url = add_query_arg(
array(
'action' => 'error_scrape',

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7-alpha-49681';
$wp_version = '5.7-alpha-49683';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.