summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2007-02-15 18:22:31 +0100
committerDerek Allard <derek.allard@ellislab.com>2007-02-15 18:22:31 +0100
commitc4ac15f47a73a2db99406d901d53803b87f255bb (patch)
tree1bc58a32ae70741020dae02e6ce699cd305109f2 /system/helpers
parentb4bca8e7344ad1d1c3e9d165a3a5b6a7650e2a28 (diff)
fixed a a value bug introduced when clearing value from textarea
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/form_helper.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 8186d4ccd..a166198fb 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -196,9 +196,15 @@ function form_textarea($data = '', $value = '', $extra = '')
{
$defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'cols' => '90', 'rows' => '12');
- $val = (( ! is_array($data) OR ! isset($data['value'])) ? $value : $data['value']);
-
- unset ($data['value']); // textareas don't use the value attribute
+ if ( ! is_array($data) OR ! isset($data['value']))
+ {
+ $val = $value;
+ }
+ else
+ {
+ $val = $data['value'];
+ unset($data['value']); // textareas don't use the value attribute
+ }
return "<textarea ".parse_form_attributes($data, $defaults).$extra.">".$val."</textarea>\n";
}