mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
Take out unnecessary compat functions from compat.php. Props hakre, ptahdunbar. see #16918
git-svn-id: https://develop.svn.wordpress.org/trunk@17603 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1370,6 +1370,36 @@ function build_query( $data ) {
|
||||
return _http_build_query( $data, null, '&', '', false );
|
||||
}
|
||||
|
||||
// from php.net (modified by Mark Jaquith to behave like the native PHP5 function)
|
||||
function _http_build_query($data, $prefix=null, $sep=null, $key='', $urlencode=true) {
|
||||
$ret = array();
|
||||
|
||||
foreach ( (array) $data as $k => $v ) {
|
||||
if ( $urlencode)
|
||||
$k = urlencode($k);
|
||||
if ( is_int($k) && $prefix != null )
|
||||
$k = $prefix.$k;
|
||||
if ( !empty($key) )
|
||||
$k = $key . '%5B' . $k . '%5D';
|
||||
if ( $v === NULL )
|
||||
continue;
|
||||
elseif ( $v === FALSE )
|
||||
$v = '0';
|
||||
|
||||
if ( is_array($v) || is_object($v) )
|
||||
array_push($ret,_http_build_query($v, '', $sep, $k, $urlencode));
|
||||
elseif ( $urlencode )
|
||||
array_push($ret, $k.'='.urlencode($v));
|
||||
else
|
||||
array_push($ret, $k.'='.$v);
|
||||
}
|
||||
|
||||
if ( NULL === $sep )
|
||||
$sep = ini_get('arg_separator.output');
|
||||
|
||||
return implode($sep, $ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a modified URL query string.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user