From 20eee9a0ab752285af6f432e4df8e5ef4d9417f5 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 17 May 2006 21:23:09 +0000 Subject: [PATCH] r829: foreach() warnings -= 3 --- includes/functions.php | 2 +- showreport.php | 31 +++++++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 623b39b..a87dfba 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -170,7 +170,7 @@ function construct_custom_fields($bug = array(), $ignore21mask = false, $nodefau $fieldvalues = $bugsys->db->query_first("SELECT * FROM " . TABLE_PREFIX . "bugvaluefill WHERE bugid = " . intval($bug['bugid'])); - $fieldbits = ''; + $fieldbits = array(); foreach ($fields AS $field) { diff --git a/showreport.php b/showreport.php index e3e872e..7014ee9 100644 --- a/showreport.php +++ b/showreport.php @@ -124,7 +124,7 @@ if ($show['edit']) } $show['assign'] = ((can_perform('canassign', $bug['productid'])) ? true : false); - if (can_perform('canassign', $bug['productid'])) + if (can_perform('canassign', $bug['productid']) AND is_array($bugsys->datastore['assignto'])) { foreach ($bugsys->datastore['assignto'] AS $dev) { @@ -155,20 +155,23 @@ if ($show['edit']) $select['autoactions'] = ''; $show['autoactions'] = false; - foreach ($bugsys->datastore['autoaction'] AS $action) + if (is_array($bugsys->datastore['autoaction'])) { - $label = $action['name']; - $value = $action['actionid']; - $selected = false; - eval('$select[autoaction] .= "' . $template->fetch('selectoption') . '";'); - $show['autoactions'] = true; - } - if ($show['autoactions']) - { - $label = ''; - $value = 0; - $selected = true; - eval('$select[autoaction] = "' . $template->fetch('selectoption') . '" . $select[autoaction];'); + foreach ($bugsys->datastore['autoaction'] AS $action) + { + $label = $action['name']; + $value = $action['actionid']; + $selected = false; + eval('$select[autoaction] .= "' . $template->fetch('selectoption') . '";'); + $show['autoactions'] = true; + } + if ($show['autoactions']) + { + $label = ''; + $value = 0; + $selected = true; + eval('$select[autoaction] = "' . $template->fetch('selectoption') . '" . $select[autoaction];'); + } } } -- 2.22.5