From 773ccc318f2769c9b7579630569b5d8ba47b114b Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 2 Jun 2012 11:11:08 +0100 Subject: Replaced `==` with `===` and `!=` with `!==` in /system/helpers --- system/helpers/form_helper.php | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'system/helpers/form_helper.php') diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index eca6c5f1e..410972187 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -52,7 +52,7 @@ if ( ! function_exists('form_open')) { $CI =& get_instance(); - if ($attributes == '') + if ($attributes === '') { $attributes = 'method="post"'; } @@ -325,7 +325,7 @@ if ( ! function_exists('form_dropdown')) $selected = array($_POST[$name]); } - if ($extra != '') $extra = ' '.$extra; + if ($extra !== '') $extra = ' '.$extra; $multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : ''; @@ -378,7 +378,7 @@ if ( ! function_exists('form_checkbox')) { $checked = $data['checked']; - if ($checked == FALSE) + if ($checked === FALSE) { unset($data['checked']); } @@ -388,7 +388,7 @@ if ( ! function_exists('form_checkbox')) } } - if ($checked == TRUE) + if ($checked === TRUE) { $defaults['checked'] = 'checked'; } @@ -506,7 +506,7 @@ if ( ! function_exists('form_label')) $label = '\n"; - if ($legend_text != '') + if ($legend_text !== '') { return $fieldset.''.$legend_text."\n"; } @@ -623,7 +623,7 @@ if ( ! function_exists('form_prep')) return $str; } - if ($field_name != '') + if ($field_name !== '') { $prepped_fields[$field_name] = $field_name; } @@ -686,7 +686,7 @@ if ( ! function_exists('set_select')) { if ( ! isset($_POST[$field])) { - if (count($_POST) === 0 && $default == TRUE) + if (count($_POST) === 0 && $default === TRUE) { return ' selected="selected"'; } @@ -702,7 +702,7 @@ if ( ! function_exists('set_select')) return ''; } } - elseif (($field == '' OR $value == '') OR ($field != $value)) + elseif (($field === '' OR $value === '') OR ($field !== $value)) { return ''; } @@ -737,7 +737,7 @@ if ( ! function_exists('set_checkbox')) { if ( ! isset($_POST[$field])) { - if (count($_POST) === 0 && $default == TRUE) + if (count($_POST) === 0 && $default === TRUE) { return ' checked="checked"'; } @@ -753,7 +753,7 @@ if ( ! function_exists('set_checkbox')) return ''; } } - elseif (($field == '' OR $value == '') OR ($field != $value)) + elseif (($field === '' OR $value === '') OR ($field !== $value)) { return ''; } @@ -788,7 +788,7 @@ if ( ! function_exists('set_radio')) { if ( ! isset($_POST[$field])) { - if (count($_POST) === 0 && $default == TRUE) + if (count($_POST) === 0 && $default === TRUE) { return ' checked="checked"'; } @@ -806,7 +806,7 @@ if ( ! function_exists('set_radio')) } else { - if (($field == '' OR $value == '') OR ($field != $value)) + if (($field === '' OR $value === '') OR ($field !== $value)) { return ''; } @@ -907,7 +907,7 @@ if ( ! function_exists('_parse_form_attributes')) foreach ($default as $key => $val) { - if ($key == 'value') + if ($key === 'value') { $val = form_prep($val, $default['name']); } @@ -936,12 +936,12 @@ if ( ! function_exists('_attributes_to_string')) { if (is_string($attributes) && strlen($attributes) > 0) { - if ($formtag == TRUE && strpos($attributes, 'method=') === FALSE) + if ($formtag === TRUE && strpos($attributes, 'method=') === FALSE) { $attributes .= ' method="post"'; } - if ($formtag == TRUE && strpos($attributes, 'accept-charset=') === FALSE) + if ($formtag === TRUE && strpos($attributes, 'accept-charset=') === FALSE) { $attributes .= ' accept-charset="'.strtolower(config_item('charset')).'"'; } -- cgit v1.2.3-24-g4f1b