Piwigo Bugtracker

Piwigo bug tracker has moved to Github

This bugtracker is kept to provide history on old issues.


View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003193Piwigootherpublic2015.01.30 16:432015.01.30 16:44
Reporterthimo 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003193: Function add_url_params returns invalid encoded url
DescriptionThe parameter "$arg_separator" of function "add_url_params" in file include/functions_url.inc.php (line 88) should default to "&" instead "&". Also each value should be url encoded:

/**
 * adds one or more _GET style parameters to an url
 * example: add_url_params('/x', array('a'=>'b')) returns /x?a=b
 * add_url_params('/x?cat_id=10', array('a'=>'b')) returns /x?cat_id=10&a=b
 * @param string url
 * @param array params
 * @return string
 */
function add_url_params($url, $params, $arg_separator='&' )
{
  if ( !empty($params) )
  {
    assert( is_array($params) );
    $is_first = true;
    foreach($params as $param=>$val)
    {
      if ($is_first)
      {
        $is_first = false;
        $url .= ( strpos($url, '?')===false ) ? '?' : $arg_separator;
      }
      else
      {
        $url .= $arg_separator;
      }
      $url .= $param;
      if (isset($val))
      {
        $url .= '='.urlencode($val);
      }
    }
  }
  return $url;
}
TagsNo tags attached.
browserany
Database engine and version
PHP version
Web serverApache 1.3.x
Attached Files

- Relationships

-  Notes
(0007743)
thimo (reporter)
2015.01.30 16:44

It should default to "&" instead "& amp;"

- Issue History
Date Modified Username Field Change
2015.01.30 16:43 thimo New Issue
2015.01.30 16:43 thimo browser => any
2015.01.30 16:43 thimo Web server => Apache 1.3.x
2015.01.30 16:44 thimo Note Added: 0007743


Copyright © 2000 - 2018 MantisBT Team
Contact
Powered by Mantis Bugtracker