Make WordPress Core

Changeset 24208


Ignore:
Timestamp:
05/08/2013 10:45:58 PM (11 years ago)
Author:
azaozz
Message:

Logged out warnings:

  • Don't use <base> tag to set target="_blank". It can break form submission. Instead, set target only on links with JS.
  • Fix same domain comparison in wp_auth_check_html() when FORCE_SSL_LOGIN == true.
  • Properly show/hide the "Close" button when the dialog is shown multiple times.

See #23295

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r24066 r24208  
    39223922 */
    39233923function wp_auth_check_html() {
    3924     $login_url = wp_login_url();
     3924    $login_url = site_url( 'wp-login.php', 'login_post' );
    39253925    $current_domain = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'];
    39263926    $same_domain = ( strpos( $login_url, $current_domain ) === 0 );
  • trunk/wp-includes/js/wp-auth-check.js

    r24179 r24208  
    6565
    6666        wrap.fadeOut( 200, function() {
    67             wrap.addClass('hidden').css('display', '');
     67            wrap.addClass('hidden').css('display', '').find('.wp-auth-check-close').css('display', '');
    6868            $('#wp-auth-check-frame').remove();
    6969        });
  • trunk/wp-login.php

    r24207 r24208  
    101101        ?>
    102102        <style type="text/css">html{background-color: transparent;}</style>
    103         <base target="_blank">
    104103        <?php
    105104
     
    664663        $errors->add('test_cookie', __("<strong>ERROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));
    665664
    666     $form_target = '';
    667665    if ( $interim_login ) {
    668         $form_target = ' target="_self"';
    669666        if ( ! $errors->get_error_code() )
    670667            $errors->add('expired', __('Session expired. Please log in again. You will not move away from this page.'), 'message');
     
    698695?>
    699696
    700 <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post"<?php echo $form_target; ?>>
     697<form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
    701698    <p>
    702699        <label for="user_login"><?php _e('Username') ?><br />
     
    758755<?php } ?>
    759756if(typeof wpOnload=='function')wpOnload();
     757<?php if ( $interim_login ) { ?>
     758(function(){
     759try {
     760    var i, links = document.getElementsByTagName('a');
     761    for ( i in links ) {
     762        if ( links[i].href )
     763            links[i].target = '_blank';
     764    }
     765} catch(e){}
     766}());
     767<?php } ?>
    760768</script>
    761769
Note: See TracChangeset for help on using the changeset viewer.