From 9db14e6aefd900cddf011206ea3ed9335978d76a Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Sun, 5 Jan 2025 11:57:02 -0500 Subject: [PATCH] Fix issue processwire/processwire-issues#1915 using fix suggested from @michaellenaghan --- wire/core/PageTraversal.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wire/core/PageTraversal.php b/wire/core/PageTraversal.php index 615470b2..f7a189e9 100644 --- a/wire/core/PageTraversal.php +++ b/wire/core/PageTraversal.php @@ -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 .= '/'; } }