From 6563382974be2a2d76b49adfaafc2600e2943c02 Mon Sep 17 00:00:00 2001 From: Kjartan Mannes Date: Mon, 4 Jun 2001 15:06:47 +0000 Subject: [PATCH] - Changed form_select() to return NULL if called without $options. This should not have any impact, and makes things look nicer imo. --- includes/common.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/common.inc b/includes/common.inc index 081c60ccb67..fcb93c6183b 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -178,8 +178,10 @@ function form_textarea($title, $name, $value, $cols, $rows, $description = 0) { } function form_select($title, $name, $value, $options, $description = 0) { - foreach ($options as $key=>$choice) $select .= ""; - return form_item($title, "", $description); + if (count($options) > 0) { + foreach ($options as $key=>$choice) $select .= ""; + return form_item($title, "", $description); + } } function form_file($title, $name, $size, $description = 0) {