mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-07-05 09:22:21 +02:00
make get_query_string_diff compatible with arrays and use build-in functions
git-svn-id: http://piwigo.org/svn/trunk@24833 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
@@ -763,25 +763,18 @@ function get_query_string_diff($rejects=array(), $escape=true)
|
||||
return '';
|
||||
}
|
||||
|
||||
$query_string = '';
|
||||
parse_str($_SERVER['QUERY_STRING'], $vars);
|
||||
|
||||
$str = $_SERVER['QUERY_STRING'];
|
||||
parse_str($str, $vars);
|
||||
|
||||
$is_first = true;
|
||||
foreach ($vars as $key => $value)
|
||||
{
|
||||
if (!in_array($key, $rejects))
|
||||
{
|
||||
$query_string.= $is_first ? '?' : ($escape ? '&' : '&' );
|
||||
$is_first = false;
|
||||
$query_string.= $key.'='.$value;
|
||||
}
|
||||
}
|
||||
|
||||
return $query_string;
|
||||
$vars = array_diff_key($vars, array_flip($rejects));
|
||||
|
||||
return '?' . http_build_query($vars, '', $escape ? '&' : '&');
|
||||
}
|
||||
|
||||
/**
|
||||
* returns true if the url is absolute (begins with http)
|
||||
* @param string $url
|
||||
* @returns boolean
|
||||
*/
|
||||
function url_is_remote($url)
|
||||
{
|
||||
if ( strncmp($url, 'http://', 7)==0
|
||||
|
||||
Reference in New Issue
Block a user