Skip to content

Commit

Permalink
Use absolute path for alternative tracker file (matomo-org#14059)
Browse files Browse the repository at this point in the history
Currently it resulted in something like `./matomo.js` for example (which causes problems with our file sync).
  • Loading branch information
tsteur authored and diosmosis committed Jan 31, 2019
1 parent faa8c38 commit 403c112
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/CustomPiwikJs/TrackerUpdater.php
Expand Up @@ -149,7 +149,7 @@ public function update()
private function updateAlternative($fromFile, $toFile, $newContent)
{
if (Common::stringEndsWith($this->toFile->getName(), $fromFile)) {
$alternativeFilename = dirname($this->toFile->getName()) . DIRECTORY_SEPARATOR . $toFile;
$alternativeFilename = dirname($this->toFile->getPath()) . DIRECTORY_SEPARATOR . $toFile;
$file = new File($alternativeFilename);
if ($file->hasWriteAccess() && $file->getContent() !== $newContent) {
$file->save($newContent);
Expand Down

0 comments on commit 403c112

Please sign in to comment.