Make WordPress Core


Ignore:
Timestamp:
10/13/2015 02:11:30 AM (10 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/plugins.php

    r34973 r35109  
    463463    <div id="message" class="error"><p><?php echo $errmsg; ?></p>
    464464    <?php
    465         if ( !isset( $_GET['main'] ) && !isset($_GET['charsout']) && wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $plugin) ) { ?>
    466     <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>
     465        if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin ) ) {
     466            $iframe_url = add_query_arg( array(
     467                'action'   => 'error_scrape',
     468                'plugin'   => urlencode( $plugin ),
     469                '_wpnonce' => urlencode( $_GET['_error_nonce'] ),
     470            ), admin_url( 'plugins.php' ) );
     471        ?>
     472        <iframe style="border:0" width="100%" height="70px" src="<?php echo esc_url( $iframe_url ); ?>"></iframe>
    467473    <?php
    468474        }
Note: See TracChangeset for help on using the changeset viewer.