Make WordPress Core


Ignore:
Timestamp:
09/08/2007 02:27:24 PM (18 years ago)
Author:
markjaquith
Message:

Only urlencode previously existing values in add_query_arg() (more backwards compatible). fixes #4935. see #4084. see #4878

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r6057 r6064  
    582582}
    583583
     584function build_query($data) {
     585    return _http_build_query($data, NULL, '&', '', false);
     586}
     587
    584588/*
    585589add_query_arg: Returns a modified querystring by adding
     
    636640
    637641    wp_parse_str($query, $qs);
     642    $qs = urlencode_deep($qs); // this re-URL-encodes things that were already in the query string
    638643    if ( is_array(func_get_arg(0)) ) {
    639644        $kayvees = func_get_arg(0);
     
    648653    }
    649654
    650     if ( ini_get('arg_separator.output') === '&')
    651         $ret = http_build_query($qs, '', '&');
    652     else
    653         $ret = _http_build_query($qs, NULL, '&');
     655    $ret = build_query($qs);
    654656    $ret = trim($ret, '?');
    655657    $ret = preg_replace('#=(&|$)#', '$1', $ret);
Note: See TracChangeset for help on using the changeset viewer.