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

Add empty check to Page::get() method to avoid potential illegal offset-type error

This commit is contained in:
Ryan Cramer
2022-06-20 16:03:32 -04:00
parent be134e1e65
commit 356cde2d5c

View File

@@ -974,6 +974,7 @@ class Page extends WireData implements \Countable, WireMatchable {
if($this->lazyLoad && $key !== 'id' && is_int($this->lazyLoad)) $this->_lazy(true);
if(is_array($key)) $key = implode('|', $key);
if(empty($key)) return null;
if(isset(PageProperties::$basePropertiesAlternates[$key])) {
$key = PageProperties::$basePropertiesAlternates[$key];
}