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:
Ryan Boren
2011-04-05 17:13:04 +00:00
parent 6a7acd8252
commit 9691cb5eb2
6 changed files with 31 additions and 1036 deletions

View File

@@ -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.
*