Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattab <matthieu.aubry@gmail.com>2014-08-04 23:38:19 +0400
committermattab <matthieu.aubry@gmail.com>2014-08-04 23:38:19 +0400
commit50be11d312473bfcdf8697ec6e449534bc01e4cb (patch)
treefcdb813bccec7df5013c46e9f16abf8acf56bc0f
parentf87e1b0d8a4883d7a6129c3cf45e74682e472830 (diff)
refs #5895 replace _GET access by helper method2.5.0-b1
as a bonus it fixes the tests without having to use a Monday night's hack
-rw-r--r--plugins/ImageGraph/ImageGraph.php6
-rw-r--r--tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml4
2 files changed, 6 insertions, 4 deletions
diff --git a/plugins/ImageGraph/ImageGraph.php b/plugins/ImageGraph/ImageGraph.php
index dbc7c528ee..5bd61cc6a9 100644
--- a/plugins/ImageGraph/ImageGraph.php
+++ b/plugins/ImageGraph/ImageGraph.php
@@ -8,6 +8,7 @@
*/
namespace Piwik\Plugins\ImageGraph;
+use Piwik\API\Request;
use Piwik\Common;
use Piwik\Config;
use Piwik\Period;
@@ -140,8 +141,9 @@ class ImageGraph extends \Piwik\Plugin
$parameters['_restrictSitesToLogin'] = $_GET['_restrictSitesToLogin'];
}
- if (!empty($_GET['segment'])) {
- $parameters['segment'] = $_GET['segment'];
+ $segment = Request::getRawSegmentFromRequest();
+ if (!empty($segment)) {
+ $parameters['segment'] = $segment;
}
$report['imageGraphUrl'] = $urlPrefix . Url::getQueryStringFromParameters($parameters);
diff --git a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml b/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
index 9e13039c79..9efeb67c66 100644
--- a/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
+++ b/tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml
@@ -30,8 +30,8 @@
<processedMetricsGoal>
<revenue_per_visit>Revenue per Visit</revenue_per_visit>
</processedMetricsGoal>
- <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserCountry&amp;apiAction=getCountry&amp;period=range&amp;date=&amp;segment=pageUrl%21%3Dhttp%3A%2F%2Funknown%2Fnot%2Fviewed</imageGraphUrl>
- <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserCountry&amp;apiAction=getCountry&amp;period=day&amp;date=&amp;segment=pageUrl%21%3Dhttp%3A%2F%2Funknown%2Fnot%2Fviewed</imageGraphEvolutionUrl>
+ <imageGraphUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserCountry&amp;apiAction=getCountry&amp;period=range&amp;date=</imageGraphUrl>
+ <imageGraphEvolutionUrl>index.php?module=API&amp;method=ImageGraph.get&amp;idSite=1&amp;apiModule=UserCountry&amp;apiAction=getCountry&amp;period=day&amp;date=</imageGraphEvolutionUrl>
<uniqueId>UserCountry_getCountry</uniqueId>
</metadata>
<columns>