r4224 bugfix: 'Invalid argument supplied for foreach' PHP error was appearing when...
authorAlexey Andriyanov <alan@al-an.info>
Mon, 14 Feb 2011 16:50:24 +0000 (16:50 +0000)
committerAlexey Andriyanov <alan@al-an.info>
Mon, 14 Feb 2011 16:50:24 +0000 (16:50 +0000)
tableHandler: checks for existence of setup subarrays added

wwwroot/inc/ophandlers.php

index 450e217..0bd3f86 100644 (file)
@@ -2795,6 +2795,9 @@ function tableHandler()
        global $sic;
        $columns = array();
        foreach (array ('arglist', 'set_arglist', 'where_arglist') as $listname)
+       {
+               if (! is_array ($opspec[$listname]))
+                       continue;
                foreach ($opspec[$listname] as $argspec)
                {
                        genericAssertion ($argspec['url_argname'], $argspec['assertion']);
@@ -2821,6 +2824,7 @@ function tableHandler()
                                }
                        $columns[$listname][$table_colname] = $arg_value;
                }
+       }
        switch ($opspec['action'])
        {
        case 'INSERT':