Make WordPress Core

Changeset 2876


Ignore:
Timestamp:
09/14/2005 08:57:21 PM (20 years ago)
Author:
matt
Message:

Allow for more redirect flexibility

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-login.php

    r2747 r2876  
    158158    $user_login = '';
    159159    $user_pass = '';
    160     $redirect_to = 'wp-admin/';
    161160    $using_cookie = false;
     161    if ( !isset( $_REQUEST['redirect_to'] ) )
     162        $redirect_to = 'wp-admin/';
     163    else
     164        $redirect_to = $_REQUEST['redirect_to'];
     165    $redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $redirect_to);
    162166
    163167    if( !empty($_POST) ) {
     
    165169        $user_pass  = $_POST['pwd'];
    166170        $rememberme = $_POST['rememberme'];
    167         $redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $_POST['redirect_to']);
    168171    } elseif ( !empty($_COOKIE) ) {
    169172        if (! empty($_COOKIE[USER_COOKIE]) )
     
    195198        }
    196199    }
    197     if ( isset($_REQUEST['redirect_to']) )
    198         $redirect_to = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $_REQUEST['redirect_to']);
    199200?>
    200201<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Note: See TracChangeset for help on using the changeset viewer.