1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-08 07:47:00 +02:00
This commit is contained in:
Ryan Cramer
2023-09-01 09:30:56 -04:00
parent fdb5a19941
commit fbf2f140a7

View File

@@ -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;
}
}