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

Privacy manager JS tracker writable check uses wrong file #16953

Closed
tsteur opened this issue Dec 14, 2020 · 0 comments · Fixed by #16970
Closed

Privacy manager JS tracker writable check uses wrong file #16953

tsteur opened this issue Dec 14, 2020 · 0 comments · Fixed by #16970
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Dec 14, 2020

See https://github.com/matomo-org/matomo/blob/4.0.5/plugins/PrivacyManager/Controller.php#L189 where it uses hard coded the path to /matomo.js. However, the path may be changed through DI like this:


    'Piwik\Plugins\CustomJsTracker\TrackerUpdater' => DI\decorate(function ($previous) {
        $to = PIWIK_DOCUMENT_ROOT . '/';
        $to .= \Piwik\SettingsPiwik::rewriteMiscUserPathWithInstanceId('misc/user/');
        $to .= 'matomo.js';

        $previous->setToFile($to);

        return $previous;
    }),

To get the correct path it might be better to use something like

StaticContainer::get('Piwik\Plugins\CustomJsTracker\TrackerUpdater')->getToFile()->getPath();
@tsteur tsteur added the Bug For errors / faults / flaws / inconsistencies etc. label Dec 14, 2020
@tsteur tsteur added this to the 4.0.x milestone Dec 14, 2020
@sgiehl sgiehl self-assigned this Dec 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants