From fbf2f140a7c7c73921b5b3e4369faf92e98bef2b Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Fri, 1 Sep 2023 09:30:56 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#1804 --- wire/core/PageTraversal.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wire/core/PageTraversal.php b/wire/core/PageTraversal.php index 79b58419..834c0430 100644 --- a/wire/core/PageTraversal.php +++ b/wire/core/PageTraversal.php @@ -650,13 +650,14 @@ class PageTraversal { $options['pageNum'] = $input->pageNum(); } - if(count($options['urlSegments'])) { + if(is_array($options['urlSegments']) && count($options['urlSegments'])) { $str = ''; - if(is_string($options['urlSegments'][0])) { + reset($options['urlSegments']); + if(is_string(key($options['urlSegments']))) { // associative array converts to key/value style URL segments foreach($options['urlSegments'] as $key => $value) { $str .= "$key/$value/"; - if(is_int($key)) $str = ''; + if(is_int($key)) $str = ''; // abort assoc array option if any int key found if($str === '') break; } }