1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-09 16:26:59 +02:00
This commit is contained in:
Ryan Cramer
2022-02-25 08:37:00 -05:00
parent 1eb156f1aa
commit fab59a5f4b

View File

@@ -1876,12 +1876,16 @@ class PagesEditor extends Wire {
if($template) $options['template'] = $template; if($template) $options['template'] = $template;
if($class) $options['pageClass'] = $class; if($class) $options['pageClass'] = $class;
if(isset($options['id']) && ctype_digit("$options[id]") && (int) $options['id'] > 0) { if(isset($options['id'])) {
if(ctype_digit("$options[id]") && (int) $options['id'] > 0) {
$options['id'] = (int) $options['id']; $options['id'] = (int) $options['id'];
if($parent && "$options[id]" === "$parent") unset($options['parent']); if($parent && "$options[id]" === "$parent") unset($options['parent']);
} else if(((int) $options['id']) === -1) {
$options['id'] = (int) $options['id']; // special case allowed for access control tests
} else { } else {
unset($options['id']); unset($options['id']);
} }
}
return $options; return $options;
} }