WordPress.org

Make WordPress Core

Changeset 35107


Ignore:
Timestamp:
10/13/2015 02:04:14 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Replace get_bloginfo( 'wpurl' ) with admin_url() in plugin editor.

Use add_query_arg() instead of constructing the URL manually.

Props johnbillion.
See #34280.

File:
1 edited

Legend:

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

    r34912 r35107  
    172172 <div id="message" class="updated"><p><?php _e('This plugin has been deactivated because your changes resulted in a <strong>fatal error</strong>.') ?></p>
    173173    <?php
    174         if ( wp_verify_nonce($_GET['_error_nonce'], 'plugin-activation-error_' . $file) ) { ?>
    175     <iframe style="border:0" width="100%" height="70px" src="<?php bloginfo('wpurl'); ?>/wp-admin/plugins.php?action=error_scrape&amp;plugin=<?php echo esc_attr($file); ?>&amp;_wpnonce=<?php echo esc_attr($_GET['_error_nonce']); ?>"></iframe>
     174        if ( wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $file ) ) {
     175            $iframe_url = add_query_arg( array(
     176                'action'   => 'error_scrape',
     177                'plugin'   => urlencode( $file ),
     178                '_wpnonce' => urlencode( $_GET['_error_nonce'] ),
     179            ), admin_url( 'plugins.php' ) );
     180            ?>
     181    <iframe style="border:0" width="100%" height="70px" src="<?php echo esc_url( $iframe_url ); ?>"></iframe>
    176182    <?php } ?>
    177183</div>
Note: See TracChangeset for help on using the changeset viewer.