Skip to content

Privacy manager JS tracker writable check uses wrong file #16953

@tsteur

Description

@tsteur

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();

Metadata

Metadata

Assignees

Labels

BugFor errors / faults / flaws / inconsistencies etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions