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
path: root/js
diff options
context:
space:
mode:
authorvipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-10-21 12:45:39 +0400
committervipsoft <vipsoft@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-10-21 12:45:39 +0400
commit3d63c83d69dbcf5063c5a47c7a218926b0dce7e5 (patch)
tree11d434c88d246d44cbcefaa56739180dfadf519f /js
parent80229e2c82c97f962da3ec82de1fa8eb8cf66fcd (diff)
piwik.js: revert [1508] and enhance to accept all these variations:
- file.zip - file.zip?key=value - script?name=file.zip - script?name=file.zip&key=value - script?name=file.zip#anchor
Diffstat (limited to 'js')
-rw-r--r--js/piwik.js5
1 files changed, 1 insertions, 4 deletions
diff --git a/js/piwik.js b/js/piwik.js
index 337642d7fa..26643558d3 100644
--- a/js/piwik.js
+++ b/js/piwik.js
@@ -610,10 +610,7 @@ if (!this.Piwik) {
linkPattern = getClassesRegExp(configLinkClasses, 'link'),
// does file extension indicate that it is a download?
- downloadExtensionsPattern = new RegExp('\\.(' + configDownloadExtensions + ')$', 'i');
-
- // remove parameters, e.g., ?q=falsepositive.zip
- href = href.replace(new RegExp('[?].*'), '');
+ downloadExtensionsPattern = new RegExp('\\.(' + configDownloadExtensions + ')([?&#]|$)', 'i');
// optimization of the if..elseif..else construct below
return linkPattern.test(className) ? 'link' : (downloadPattern.test(className) || downloadExtensionsPattern.test(href) ? 'download' : 0);