Make WordPress Core


Ignore:
Timestamp:
06/15/2007 05:35:56 PM (19 years ago)
Author:
ryan
Message:

wp_parse_str() from mdawaffe. fixes #4467

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-includes/functions.php

    r5706 r5713  
    802802    }
    803803
    804     parse_str($query, $qs);
    805     if ( get_magic_quotes_gpc() )
    806         $qs = stripslashes_deep($qs); // parse_str() adds slashes if magicquotes is on.  See: http://php.net/parse_str
     804    wp_parse_str($query, $qs);
    807805    $qs = urlencode_deep($qs);
    808806    if ( is_array(func_get_arg(0)) ) {
     
    14821480
    14831481function wp_parse_args( $args, $defaults = '' ) {
    1484     if ( is_array($args) ) :
     1482    if ( is_array( $args ) )
    14851483        $r =& $args;
    1486     else :
    1487         parse_str( $args, $r );
    1488         if ( get_magic_quotes_gpc() )
    1489             $r = stripslashes_deep( $r );
    1490     endif;
    1491 
    1492     if ( is_array($defaults) ) :
    1493         extract($defaults);
    1494         extract($r);
    1495         return compact(array_keys($defaults)); // only those options defined in $defaults
    1496     else :
     1484    else
     1485        wp_parse_str( $args, $r );
     1486
     1487    if ( is_array( $defaults ) )
     1488        return array_merge( $defaults, $r );
     1489    else
    14971490        return $r;
    1498     endif;
    14991491}
    15001492
Note: See TracChangeset for help on using the changeset viewer.