1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-12 01:34:31 +02:00

Fix issue in PagesPathFinder with required vs. disallowed trailing slash setting for root level pages

This commit is contained in:
Ryan Cramer
2021-10-22 15:21:50 -04:00
parent b269c1cad7
commit bbb7ea3857

View File

@@ -1165,7 +1165,10 @@ class PagesPathFinder extends Wire {
$result['language']['name'] = 'default';
if($row['parent_id'] === 1) {
$path = "/$path/";
$template = $this->wire()->templates->get($row['templates_id']);
$slashUrls = $template ? (int) $template->slashUrls : 0;
$slash = ($slashUrls ? $slashUrls > 0 : substr($path, -1) === '/');
$path = "/$path" . ($slash ? '/' : '');
} else {
// global unique, must redirect to its actual path
$page = $this->pages->getOneById((int) $row['id'], array(