Make WordPress Core

Ticket #4084: 4084.diff

File 4084.diff, 732 bytes (added by mdawaffe, 18 years ago)
  • wp-includes/functions.php

     
    815815
    816816        foreach($qs as $k => $v) {
    817817                if ( $v !== FALSE ) {
     818                        $v = rawurlencode($v);
    818819                        if ( $ret != '' )
    819820                                $ret .= '&';
    820821                        if ( empty($v) && !preg_match('|[?&]' . preg_quote($k, '|') . '=|', $query) )
     
    823824                                $ret .= "$k=$v";
    824825                }
    825826        }
     827        $ret = trim($ret, '?');
    826828        $ret = $protocol . $base . $ret . $frag;
    827829        if ( get_magic_quotes_gpc() )
    828830                $ret = stripslashes($ret); // parse_str() adds slashes if magicquotes is on.  See: http://php.net/parse_str
    829         return trim($ret, '?');
     831        return $ret;
    830832}
    831833
    832834/*