diff --git a/plugins/SegmentEditor/templates/Segmentation.js b/plugins/SegmentEditor/templates/Segmentation.js index 0b5ab931478..89f93edf4aa 100644 --- a/plugins/SegmentEditor/templates/Segmentation.js +++ b/plugins/SegmentEditor/templates/Segmentation.js @@ -49,6 +49,9 @@ Segmentation = (function($) { } var setSegment = function(segmentStr){ + if(!$.browser.mozilla) { + segmentStr = encodeURIComponent(segmentStr); + } self.currentSegmentStr = segmentStr; } diff --git a/plugins/UserCountryMap/Controller.php b/plugins/UserCountryMap/Controller.php index 5195ec7421c..611bd71ef01 100644 --- a/plugins/UserCountryMap/Controller.php +++ b/plugins/UserCountryMap/Controller.php @@ -67,17 +67,19 @@ public function visitorMap() )); // template for ajax requests - $view->reqParamsJSON = Piwik_Common::json_encode(array( - 'period' => $period, - 'idSite' => $idSite, - 'date' => $date, - 'token_auth' => $token_auth, - 'format' => 'json', - 'segment' => Piwik_ViewDataTable::getRawSegmentFromRequest(), - 'showRawMetrics' => 1, - 'enable_filter_excludelowpop' => 1, - 'filter_excludelowpop_value' => -1 - )); + $params = array( + 'period' => $period, + 'idSite' => $idSite, + 'date' => $date, + 'token_auth' => $token_auth, + 'format' => 'json', + 'segment' => Piwik_ViewDataTable::getRawSegmentFromRequest(), + 'showRawMetrics' => 1, + 'enable_filter_excludelowpop' => 1, + 'filter_excludelowpop_value' => -1 + ); + $params = array_filter($params); + $view->reqParamsJSON = Piwik_Common::json_encode($params); $view->metrics = $config['metrics'] = $this->getMetrics($idSite, $period, $date, $token_auth); $config['svgBasePath'] = 'plugins/UserCountryMap/svg/'; $config['mapCssPath'] = 'plugins/UserCountryMap/css/map.css';