Index: wp-includes/formatting.php
===================================================================
--- wp-includes/formatting.php	(revision 5666)
+++ wp-includes/formatting.php	(working copy)
@@ -1188,4 +1188,11 @@
 	return $value;
 }
 
+function wp_parse_str( $string, &$array ) {
+	parse_str( $string, $array )
+	if ( get_magic_quotes_gpc() )
+		$array = stripslashes_deep( $array ); // parse_str() adds slashes if magicquotes is on.  See: http://php.net/parse_str
+	$array = apply_filters( 'wp_parse_str', $array );
+}
+
 ?>
Index: wp-includes/general-template.php
===================================================================
--- wp-includes/general-template.php	(revision 5666)
+++ wp-includes/general-template.php	(working copy)
@@ -968,28 +968,25 @@
 	echo $output;
 }
 
-function paginate_links( $arg = '' ) {
-	if ( is_array($arg) )
-		$a = &$arg;
-	else
-		parse_str($arg, $a);
+function paginate_links( $args = '' ) {
+	$defaults = array( 
+		'base' => '%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below)
+		'format' => '?page=%#%', // ?page=%#% : %#% is replaced by the page number
+		'total' => 1,
+		'current' => 0,
+		'show_all' => false,
+		'prev_next' => true,
+		'prev_text' => __('&laquo; Previous'),
+		'next_text' => __('Next &raquo;'),
+		'end_size' => 1, // How many numbers on either end including the end
+		'mid_size' => 2, // How many numbers to either side of current not including current
+		'type' => 'plain',
+		'add_args' => false // array of query args to aadd
+	);
 
-	// Defaults
-	$base = '%_%'; // http://example.com/all_posts.php%_% : %_% is replaced by format (below)
-	$format = '?page=%#%'; // ?page=%#% : %#% is replaced by the page number
-	$total = 1;
-	$current = 0;
-	$show_all = false;
-	$prev_next = true;
-	$prev_text = __('&laquo; Previous');
-	$next_text = __('Next &raquo;');
-	$end_size = 1; // How many numbers on either end including the end
-	$mid_size = 2; // How many numbers to either side of current not including current
-	$type = 'plain';
-	$add_args = false; // array of query args to aadd
+	$args = wp_parse_args( $args, $defaults );
+	extract($args, EXTR_SKIP);
 
-	extract($a);
-
 	// Who knows what else people pass in $args
 	$total    = (int) $total;
 	if ( $total < 2 )
Index: wp-includes/functions.php
===================================================================
--- wp-includes/functions.php	(revision 5666)
+++ wp-includes/functions.php	(working copy)
@@ -603,9 +603,7 @@
 		$query = $uri;
 	}
 
-	parse_str($query, $qs);
-	if ( get_magic_quotes_gpc() )
-		$qs = stripslashes_deep($qs); // parse_str() adds slashes if magicquotes is on.  See: http://php.net/parse_str
+	wp_parse_str($query, $qs);
 	$qs = urlencode_deep($qs);
 	if ( is_array(func_get_arg(0)) ) {
 		$kayvees = func_get_arg(0);
@@ -1287,20 +1285,15 @@
 }
 
 function wp_parse_args( $args, $defaults = '' ) {
-	if ( is_array( $args ) ) {
+	if ( is_array( $args ) )
 		$r =& $args;
-	} else {
-		parse_str( $args, $r );
-		if ( get_magic_quotes_gpc() ) {
-			$r = stripslashes_deep( $r );
-		}
-	}
+	else
+		wp_parse_str( $args, $r );
 	
-	if ( is_array( $defaults ) ) {
+	if ( is_array( $defaults ) )
 		return array_merge( $defaults, $r );
-	} else {
+	else
 		return $r;
-	}
 }
 
 function wp_maybe_load_widgets() {
@@ -1323,4 +1316,4 @@
 	while ( @ob_end_flush() );
 }
 
-?>
\ No newline at end of file
+?>

