From 97214f08c559daafba7cc733ac19b948fbdd7960 Mon Sep 17 00:00:00 2001 From: Demian Katz <demian.katz@villanova.edu> Date: Tue, 12 Sep 2017 10:17:04 -0400 Subject: [PATCH] Fixed encoding. --- module/VuFind/src/VuFind/View/Helper/Root/Piwik.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/Piwik.php b/module/VuFind/src/VuFind/View/Helper/Root/Piwik.php index c69324b309d..ae1f1a899e3 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/Piwik.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/Piwik.php @@ -417,6 +417,7 @@ class Piwik extends \Zend\View\Helper\AbstractHelper */ protected function getOpeningTrackingCode() { + $escape = $this->getView()->plugin('escapejs'); return <<<EOT function initVuFindPiwikTracker{$this->timestamp}(){ @@ -424,7 +425,7 @@ function initVuFindPiwikTracker{$this->timestamp}(){ VuFindPiwikTracker.setSiteId({$this->siteId}); VuFindPiwikTracker.setTrackerUrl('{$this->url}piwik.php'); - VuFindPiwikTracker.setCustomUrl('{$this->getCustomUrl()}'); + VuFindPiwikTracker.setCustomUrl('{$escape($this->getCustomUrl())}'); EOT; } @@ -436,7 +437,7 @@ EOT; */ protected function getCustomUrl() { - $path = $this->request->getUri()->getPath(); + $path = $this->request->getUri()->toString(); $routeMatch = $this->router->match($this->request); if ($routeMatch && $routeMatch->getMatchedRouteName() == 'vufindrecord-ajaxtab' -- GitLab