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:
parent
6690680e9c
commit
927472de19
|
@ -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];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue