Make WordPress Core

Ticket #25921: 25921.patch

File 25921.patch, 1.0 KB (added by jbkkd, 10 years ago)

Actually, correct solution would probably be this - make the cookie insecure, regardless of the state of forced ssl login. If we're in HTTPS but redirecting to HTTP, it doesn't matter if secure login is needed or not.

  • src/wp-login.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    743743        // If the user was redirected to a secure login form from a non-secure admin page, and secure login is required but secure admin is not, then don't use a secure
    744744        // cookie and redirect back to the referring non-secure admin page. This allows logins to always be POSTed over SSL while allowing the user to choose visiting
    745745        // the admin via http or https.
    746         if ( !$secure_cookie && is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) )
     746        if ( !$secure_cookie && is_ssl() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) )
    747747                $secure_cookie = false;
    748748
    749749        // If cookies are disabled we can't log in even with a valid user+pass