SF.net SVN: phpwiki:[10895] trunk/lib/Template.php

vargenau--- via phpwiki-checkins <[email protected]> Thu, 13 Jan 2022 16:08:30 +0000
Newsgroups gmane.comp.web.wiki.phpwiki.checkins
Message-ID <[email protected]>
Revision: 10895
          http://sourceforge.net/p/phpwiki/code/10895
Author:   vargenau
Date:     2022-01-13 16:08:30 +0000 (Thu, 13 Jan 2022)
Log Message:
-----------
check arguments for array_merge

Modified Paths:
--------------
    trunk/lib/Template.php

Modified: trunk/lib/Template.php
===================================================================
--- trunk/lib/Template.php	2022-01-13 15:16:42 UTC (rev 10894)
+++ trunk/lib/Template.php	2022-01-13 16:08:30 UTC (rev 10895)
@@ -144,7 +144,11 @@
     {
         if (!is_array($defaults)) // HTML object or template object
             $defaults = array('CONTENT' => $defaults);
-        $this->_vars = array_merge($defaults, $this->_locals);
+        if (is_array($this->_locals)) {
+            $this->_vars = array_merge($defaults, $this->_locals);
+        } else {
+            $this->_vars = $defaults;
+        }
         extract($this->_vars);
 
         global $request;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.