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.

git-svn-id: https://develop.svn.wordpress.org/trunk@49683 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2020-11-23 13:34:21 +00:00
parent 31315dd401
commit 617097260d

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',