Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add conditional checks for overlay plugin #20

Merged
merged 1 commit into from Feb 3, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions js/piwik.js
Expand Up @@ -910,8 +910,10 @@ var
var referrer = documentAlias.referrer;
var testReferrer = configTrackerUrl;

// remove piwik.php from referrer
testReferrer = testReferrer.substring(0, testReferrer.length - 9);
// remove piwik.php from referrer if present
if(testReferrer.substr(-9) == "piwik.php") {
testReferrer = testReferrer.substring(0, testReferrer.length - 9);
}

// remove protocol
testReferrer.substring(testReferrer.substring(0, 7) === 'http://' ? 7 : 8, testReferrer.length);
Expand Down Expand Up @@ -950,7 +952,10 @@ var
*/
function injectOverlayScripts(configTrackerUrl, configTrackerSiteId) {
var windowNameParts = window.name.split('###');
var root = configTrackerUrl.substring(0, configTrackerUrl.length - 9); // remove piwik.php
var root = configTrackerUrl;
if(root.substr(-9) == "piwik.php") {
root = root.substring(0, root.length - 9); // remove piwik.php if present
}
var period = windowNameParts[1];
var date = windowNameParts[2];

Expand Down