From c4558a60f40cd5cddc55fe4abe25b9c98920f18b Mon Sep 17 00:00:00 2001 From: "Ap.Muthu" Date: Mon, 8 Apr 2013 23:29:19 +0530 Subject: [PATCH] Installer Class missing array variable check Fixes: PHP Warning: substr() expects parameter 1 to be string, array given in /var/www/openemr/library/classes/Installer.class.php on line 311, referer: http://openemr.example.com/setup.php?site=default Explained in Forum Post: https://sourceforge.net/p/openemr/discussion/202506/thread/848c1507/ --- library/classes/Installer.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/classes/Installer.class.php b/library/classes/Installer.class.php index 74cc57d3a..a22790531 100644 --- a/library/classes/Installer.class.php +++ b/library/classes/Installer.class.php @@ -308,7 +308,7 @@ $config = 1; ///////////// foreach ($GLOBALS_METADATA as $grpname => $grparr) { foreach ($grparr as $fldid => $fldarr) { list($fldname, $fldtype, $flddef, $flddesc) = $fldarr; - if (substr($fldtype, 0, 2) !== 'm_') { + if (is_array($fldtype) || substr($fldtype, 0, 2) !== 'm_') { $res = $this->execute_sql("SELECT count(*) AS count FROM globals WHERE gl_name = '$fldid'"); $row = @mysql_fetch_array($res, MYSQL_ASSOC); if (empty($row['count'])) { -- 2.11.4.GIT