From 0a8cfa318a853943bc315d17c36cc4d7d6680f8b Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 12 Sep 2007 03:52:16 +0000 Subject: urls used in http redirections must not be html escaped (eg. should use & instead of &) git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2088 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions.inc.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'include/functions.inc.php') diff --git a/include/functions.inc.php b/include/functions.inc.php index b120cd0a6..aee815866 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -428,7 +428,7 @@ function pwg_log($image_id = null, $image_type = null) } $do_log = trigger_event('pwg_log_allowed', $do_log, $image_id, $image_type); - + if (!$do_log) { return false; @@ -458,7 +458,7 @@ SELECT CURDATE(), CURTIME() list($curyear, $curmonth, $curday) = explode('-', $curdate); list($curhour) = explode(':', $curtime); - + $query = ' INSERT INTO '.HISTORY_TABLE.' ( @@ -711,9 +711,10 @@ function redirect( $url , $msg = '', $refresh_time = 0) * returns $_SERVER['QUERY_STRING'] whitout keys given in parameters * * @param array $rejects + * @param boolean $escape - if true escape & to & (for html) * @returns string */ -function get_query_string_diff($rejects = array()) +function get_query_string_diff($rejects=array(), $escape=true) { $query_string = ''; @@ -725,7 +726,7 @@ function get_query_string_diff($rejects = array()) { if (!in_array($key, $rejects)) { - $query_string.= $is_first ? '?' : '&'; + $query_string.= $is_first ? '?' : ($escape ? '&' : '&' ); $is_first = false; $query_string.= $key.'='.$value; } @@ -837,7 +838,7 @@ function get_thumbnail_title($element_info) { $thumbnail_title = ''; } - + if (!empty($element_info['filesize'])) { $thumbnail_title .= ' : '.l10n_dec('%d Kb', '%d Kb', $element_info['filesize']); @@ -1073,7 +1074,7 @@ function get_l10n_args($key, $args) * returns a string with formated with l10n_args elements * * @param element/array $key_args: element or array of l10n_args elements - * @param $sep: if $key_args is array, + * @param $sep: if $key_args is array, * separator is used when translated l10n_args elements are concated * @return string */ -- cgit v1.2.3