diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-08-04 23:38:19 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-08-04 23:38:19 +0400 |
commit | 50be11d312473bfcdf8697ec6e449534bc01e4cb (patch) | |
tree | fcdb813bccec7df5013c46e9f16abf8acf56bc0f | |
parent | f87e1b0d8a4883d7a6129c3cf45e74682e472830 (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.php | 6 | ||||
-rw-r--r-- | tests/PHPUnit/Integration/expected/test_periodIsRange_dateIsLastN_MetadataAndNormalAPI__API.getProcessedReport_range.xml | 4 |
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&method=ImageGraph.get&idSite=1&apiModule=UserCountry&apiAction=getCountry&period=range&date=&segment=pageUrl%21%3Dhttp%3A%2F%2Funknown%2Fnot%2Fviewed</imageGraphUrl> - <imageGraphEvolutionUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=UserCountry&apiAction=getCountry&period=day&date=&segment=pageUrl%21%3Dhttp%3A%2F%2Funknown%2Fnot%2Fviewed</imageGraphEvolutionUrl> + <imageGraphUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=UserCountry&apiAction=getCountry&period=range&date=</imageGraphUrl> + <imageGraphEvolutionUrl>index.php?module=API&method=ImageGraph.get&idSite=1&apiModule=UserCountry&apiAction=getCountry&period=day&date=</imageGraphEvolutionUrl> <uniqueId>UserCountry_getCountry</uniqueId> </metadata> <columns> |