From 35869e115ffd9ca188f869cb3cb4ff7925617e1f Mon Sep 17 00:00:00 2001 From: Fernando Ontiveros Date: Wed, 16 Apr 2025 23:24:34 +0000 Subject: [PATCH] Added validation when $parent is null --- gulliver/system/class.templatePower.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulliver/system/class.templatePower.php b/gulliver/system/class.templatePower.php index f3c2c4c6f..11d361b1d 100644 --- a/gulliver/system/class.templatePower.php +++ b/gulliver/system/class.templatePower.php @@ -605,7 +605,7 @@ class TemplatePower extends TemplatePowerParser public function newBlock($blockname) { $parent = &$this->content[$this->parent[$blockname] . '_' . $this->index[$this->parent[$blockname]]]; - $lastitem = sizeof($parent); + $lastitem = !is_null($parent) ? sizeof($parent) : 0; $lastitem > 1 ? $lastitem-- : $lastitem = 0; $ind_blockname = $blockname . '_' . $this->index[$blockname]; if (!isset($parent[$lastitem]["_B:$blockname"])) {