1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00

Fix issue processwire/processwire-issues#1915 using fix suggested from @michaellenaghan

This commit is contained in:
Ryan Cramer
2025-01-05 11:57:02 -05:00
parent 8d2ad63ce7
commit 9db14e6aef

View File

@@ -624,7 +624,7 @@ class PageTraversal {
'host' => '',
'pageNum' => is_int($options) || (is_string($options) && in_array($options, array('+', '-'))) ? $options : 1,
'data' => array(),
'urlSegmentStr' => is_string($options) ? $options : '',
'urlSegmentStr' => (is_string($options) && !in_array($options, array('+', '-'))) ? $options : '',
'urlSegments' => array(),
'language' => is_object($options) && wireInstanceOf($options, 'Language') ? $options : null,
);
@@ -707,7 +707,7 @@ class PageTraversal {
}
if(!strlen($prefix)) $prefix = $config->pageNumUrlPrefix;
$url = rtrim($url, '/') . '/' . $prefix . ((int) $options['pageNum']);
if($template->slashPageNum) $url .= '/';
if(((int) $template->slashPageNum) === 1) $url .= '/';
}
}