From 1e30a12eb5354d05015dee9161fc3bf6aaadff51 Mon Sep 17 00:00:00 2001 From: rob1n Date: Wed, 9 May 2007 04:19:19 +0000 Subject: [PATCH] Bit of clean-up. git-svn-id: http://svn.automattic.com/wordpress/trunk@5415 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 5c5c2a584..7149c0aeb 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1490,21 +1490,24 @@ function smilies_init() { } function wp_parse_args( $args, $defaults = '' ) { - if ( is_array($args) ) : + if ( is_array( $args ) ) { $r =& $args; - else : + } else { parse_str( $args, $r ); - if ( get_magic_quotes_gpc() ) + if ( get_magic_quotes_gpc() ) { $r = stripslashes_deep( $r ); - endif; - - if ( is_array($defaults) ) : - extract($defaults); - extract($r); - return compact(array_keys($defaults)); // only those options defined in $defaults - else : + } + } + + if ( is_array( $defaults ) ) { + extract( $defaults ); + extract( $r ); + // Note: this only returns the variables that were in $defaults + // to begin with. All other variables are discarded. + return compact( array_keys( $defaults ) ); + } else { return $r; - endif; + } } function wp_maybe_load_widgets() {