Replace get_bloginfo( 'wpurl' ) with admin_url() for plugin activation error message.

Use `add_query_arg()` instead of constructing the URL manually.

Props johnbillion.
Fixes #34280.

git-svn-id: https://develop.svn.wordpress.org/trunk@35109 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2015-10-13 02:11:30 +00:00
parent 20225eb62a
commit e654f82ce5

View File

@@ -462,8 +462,14 @@ if ( ! empty( $invalid ) ) {
?>
<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) ) { ?>
<iframe style="border:0" width="100%" height="70px" src="<?php echo 'plugins.php?action=error_scrape&amp;plugin=' . esc_attr($plugin) . '&amp;_wpnonce=' . esc_attr($_GET['_error_nonce']); ?>"></iframe>
if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin ) ) {
$iframe_url = add_query_arg( array(
'action' => 'error_scrape',
'plugin' => urlencode( $plugin ),
'_wpnonce' => urlencode( $_GET['_error_nonce'] ),
), admin_url( 'plugins.php' ) );
?>
<iframe style="border:0" width="100%" height="70px" src="<?php echo esc_url( $iframe_url ); ?>"></iframe>
<?php
}
?>