Skip to content

Commit

Permalink
fix(pages): Set correct filePath for shares of subpages
Browse files Browse the repository at this point in the history
Fixes: #1147

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Mar 27, 2024
1 parent 6aba520 commit 15fed98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Controller/PublicPageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ private function decoratePageInfo(int $collectiveId, int $sharePageId, string $o
$pageInfo->setCollectivePath('');
// Remove root page from file path on page shares
if ($sharePageId !== 0) {
$rootPageName = $this->service->find($collectiveId, $sharePageId, $owner)->getTitle();
$pageInfo->setFilePath(preg_replace('/^' . $rootPageName . '\/?/', '', $pageInfo->getFilePath()));
$rootPagePath = $this->service->find($collectiveId, $sharePageId, $owner)->getFilePath();
$pageInfo->setFilePath(preg_replace('/^' . preg_quote($rootPagePath, '/') . '\/?/', '', $pageInfo->getFilePath()));
}
$pageInfo->setShareToken($this->getToken());
}
Expand Down

0 comments on commit 15fed98

Please sign in to comment.