diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/default/input/checkboxes.php | 5 | ||||
-rw-r--r-- | views/default/input/radio.php | 8 | ||||
-rw-r--r-- | views/failsafe/input/checkboxes.php | 6 |
3 files changed, 11 insertions, 8 deletions
diff --git a/views/default/input/checkboxes.php b/views/default/input/checkboxes.php index 088a97709..dfab90a0a 100644 --- a/views/default/input/checkboxes.php +++ b/views/default/input/checkboxes.php @@ -49,9 +49,8 @@ if ($options) { // ignores the label (because it's just the index) and sets the value ($option) // as the label. // Wow. - $labelint = (int) $label; - - if ("{$label}" == "{$labelint}") { + // @todo deprecate in Elgg 1.8 + if (is_integer($label)) { $label = $option; } diff --git a/views/default/input/radio.php b/views/default/input/radio.php index fe7335b8a..8520b2b83 100644 --- a/views/default/input/radio.php +++ b/views/default/input/radio.php @@ -30,11 +30,13 @@ foreach($vars['options'] as $label => $option) { } else { $selected = "checked = \"checked\""; } - $labelint = (int) $label; - if ("{$label}" == "{$labelint}") { + + // handle indexed array where label is not specified + // @todo deprecate in Elgg 1.8 + if (is_integer($label)) { $label = $option; } - + if (isset($vars['internalid'])) { $id = "id=\"{$vars['internalid']}\""; } diff --git a/views/failsafe/input/checkboxes.php b/views/failsafe/input/checkboxes.php index 0cc32958f..0792f09ce 100644 --- a/views/failsafe/input/checkboxes.php +++ b/views/failsafe/input/checkboxes.php @@ -35,8 +35,10 @@ foreach($vars['options'] as $label => $option) { $selected = "checked = \"checked\""; } } - $labelint = (int) $label; - if ("{$label}" == "{$labelint}") { + + // handle indexed array where label is not specified + // @todo deprecate in Elgg 1.8 + if (is_integer($label)) { $label = $option; } |