Better wp_reset_vars() behavior when var is already set. props scribu. fixes #11974

git-svn-id: http://svn.automattic.com/wordpress/trunk@12831 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
markjaquith 2010-01-26 06:06:14 +00:00
parent 6690680e9c
commit 927472de19
1 changed files with 7 additions and 9 deletions

View File

@ -245,15 +245,13 @@ function wp_reset_vars( $vars ) {
$var = $vars[$i];
global $$var;
if (!isset( $$var ) ) {
if ( empty( $_POST[$var] ) ) {
if ( empty( $_GET[$var] ) )
$$var = '';
else
$$var = $_GET[$var];
} else {
$$var = $_POST[$var];
}
if ( empty( $_POST[$var] ) ) {
if ( empty( $_GET[$var] ) )
$$var = '';
else
$$var = $_GET[$var];
} else {
$$var = $_POST[$var];
}
}
}