diff --git a/core/Url.php b/core/Url.php index 6db8ed7ee5b4eea9b36306a3693bc577990cac94..3e38b4718a0b40170b911117412cf511f100bde8 100644 --- a/core/Url.php +++ b/core/Url.php @@ -420,7 +420,7 @@ class Url /** * Converts an array of parameters name => value mappings to a query - * string. + * string. Values must already be URL encoded before you call this function. * * @param array $parameters eg. `array('param1' => 10, 'param2' => array(1,2))` * @return string eg. `"param1=10¶m2[]=1¶m2[]=2"` diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php index 85fa98bc3edbf64655eeefdae3b6b12b1d7687ab..c27dc28529ed5a38ec164bc83c2a7290bbfa32e1 100644 --- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php +++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php @@ -11,11 +11,11 @@ namespace Piwik\Plugins\CoreHome\DataTableRowAction; use Exception; use Piwik\API\DataTablePostProcessor; use Piwik\API\Request; -use Piwik\API\ResponseBuilder; use Piwik\Common; use Piwik\DataTable; use Piwik\Date; use Piwik\Metrics; +use Piwik\Period\Factory as PeriodFactory; use Piwik\Piwik; use Piwik\Plugins\CoreVisualizations\Visualizations\JqplotGraph\Evolution as EvolutionViz; use Piwik\Url; @@ -95,7 +95,7 @@ class RowEvolution if ($this->label === '') throw new Exception("Parameter label not set."); $this->period = Common::getRequestVar('period', '', 'string'); - if (empty($this->period)) throw new Exception("Parameter period not set."); + PeriodFactory::checkPeriodIsEnabled($this->period); $this->idSite = $idSite; $this->graphType = $graphType; @@ -146,7 +146,7 @@ class RowEvolution $parameters = array( 'method' => 'API.getRowEvolution', - 'label' => $this->label, + 'label' => urlencode($this->label), 'apiModule' => $apiModule, 'apiAction' => $apiAction, 'idSite' => $this->idSite,