summaryrefslogtreecommitdiffstats
path: root/system/helpers/form_helper.php
diff options
context:
space:
mode:
authorAlex Bilbie <alex@alexbilbie.com>2012-06-02 12:11:08 +0200
committerAlex Bilbie <alex@alexbilbie.com>2012-06-02 12:11:08 +0200
commit773ccc318f2769c9b7579630569b5d8ba47b114b (patch)
tree6f6f5f7a1c5043a067df9cc6c0dce670d8b26880 /system/helpers/form_helper.php
parent48a2baf0e288accd206f5da5031d29076e130792 (diff)
Replaced `==` with `===` and `!=` with `!==` in /system/helpers
Diffstat (limited to 'system/helpers/form_helper.php')
-rw-r--r--system/helpers/form_helper.php32
1 files changed, 16 insertions, 16 deletions
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 = '<label';
- if ($id != '')
+ if ($id !== '')
{
$label .= ' for="'.$id.'"';
}
@@ -540,7 +540,7 @@ if ( ! function_exists('form_fieldset'))
function form_fieldset($legend_text = '', $attributes = array())
{
$fieldset = '<fieldset'._attributes_to_string($attributes, FALSE).">\n";
- if ($legend_text != '')
+ if ($legend_text !== '')
{
return $fieldset.'<legend>'.$legend_text."</legend>\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')).'"';
}