From 3babea7dea3a78d63829512c03c96413b3bed1f6 Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Sun, 3 Feb 2013 11:57:07 -0500 Subject: [PATCH] Fixed issue with labels --- classes/HTML.php | 14 ++++++++++---- jar.php | 14 ++++++++++---- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/classes/HTML.php b/classes/HTML.php index a7c1ad3..f4a1c66 100644 --- a/classes/HTML.php +++ b/classes/HTML.php @@ -63,11 +63,17 @@ class HTML extends Object } } - if (isset($attributes['label'], $attributes['name'])) + if (is_array($attributes) && isset($attributes['label'])) { - $label = $this->label(array('for' => $attributes['name']), $attributes['label']); - - unset($attributes['label']); + if (isset($attributes['name'])) + { + $label = $this->label(array('for' => $attributes['name']), $attributes['label']); + unset($attributes['label']); + } + else + { + $label = $this->label($attributes['label']); + } return $label . $this->$method($attributes); } diff --git a/jar.php b/jar.php index 169d4ff..a7af888 100755 --- a/jar.php +++ b/jar.php @@ -4222,11 +4222,17 @@ class HTML extends Object } } - if (isset($attributes['label'], $attributes['name'])) + if (is_array($attributes) && isset($attributes['label'])) { - $label = $this->label(array('for' => $attributes['name']), $attributes['label']); - - unset($attributes['label']); + if (isset($attributes['name'])) + { + $label = $this->label(array('for' => $attributes['name']), $attributes['label']); + unset($attributes['label']); + } + else + { + $label = $this->label($attributes['label']); + } return $label . $this->$method($attributes); }