summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorAhmad Anbar <aanbar@gmail.com>2015-02-04 18:20:01 +0100
committerAhmad Anbar <aanbar@gmail.com>2015-02-04 18:20:01 +0100
commite5454f9b28f123a5549971f580255a065b2f8cc2 (patch)
treec4927e7b7afb0bf242976034630cc60f2f1db00f /system/helpers
parent6db62ab0ad0e223806a1367e12b1884b48dc65d7 (diff)
parenteccac6e6a73a4d1a5b40f383ce64359c2c94ae12 (diff)
Merge remote-tracking branch 'upstream/develop' into develop
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/array_helper.php3
-rw-r--r--system/helpers/captcha_helper.php3
-rw-r--r--system/helpers/cookie_helper.php3
-rw-r--r--system/helpers/date_helper.php3
-rw-r--r--system/helpers/directory_helper.php3
-rw-r--r--system/helpers/download_helper.php3
-rw-r--r--system/helpers/email_helper.php3
-rw-r--r--system/helpers/file_helper.php3
-rw-r--r--system/helpers/form_helper.php47
-rw-r--r--system/helpers/html_helper.php3
-rw-r--r--system/helpers/inflector_helper.php3
-rw-r--r--system/helpers/language_helper.php3
-rw-r--r--system/helpers/number_helper.php3
-rw-r--r--system/helpers/path_helper.php3
-rw-r--r--system/helpers/security_helper.php3
-rw-r--r--system/helpers/smiley_helper.php3
-rw-r--r--system/helpers/string_helper.php3
-rw-r--r--system/helpers/text_helper.php3
-rw-r--r--system/helpers/typography_helper.php3
-rw-r--r--system/helpers/url_helper.php3
-rw-r--r--system/helpers/xml_helper.php3
21 files changed, 14 insertions, 93 deletions
diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php
index c4fa330ea..e07b52bb5 100644
--- a/system/helpers/array_helper.php
+++ b/system/helpers/array_helper.php
@@ -113,6 +113,3 @@ if ( ! function_exists('elements'))
return $return;
}
}
-
-/* End of file array_helper.php */
-/* Location: ./system/helpers/array_helper.php */ \ No newline at end of file
diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php
index 7cdc0aff2..201987ac8 100644
--- a/system/helpers/captcha_helper.php
+++ b/system/helpers/captcha_helper.php
@@ -251,6 +251,3 @@ if ( ! function_exists('create_captcha'))
return array('word' => $word, 'time' => $now, 'image' => $img, 'filename' => $img_filename);
}
}
-
-/* End of file captcha_helper.php */
-/* Location: ./system/helpers/captcha_helper.php */ \ No newline at end of file
diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php
index ce714d011..c2dc73a17 100644
--- a/system/helpers/cookie_helper.php
+++ b/system/helpers/cookie_helper.php
@@ -111,6 +111,3 @@ if ( ! function_exists('delete_cookie'))
set_cookie($name, '', '', $domain, $path, $prefix);
}
}
-
-/* End of file cookie_helper.php */
-/* Location: ./system/helpers/cookie_helper.php */ \ No newline at end of file
diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php
index 56f15e877..c9b71c30f 100644
--- a/system/helpers/date_helper.php
+++ b/system/helpers/date_helper.php
@@ -794,6 +794,3 @@ if ( ! function_exists('date_range'))
return $range;
}
}
-
-/* End of file date_helper.php */
-/* Location: ./system/helpers/date_helper.php */ \ No newline at end of file
diff --git a/system/helpers/directory_helper.php b/system/helpers/directory_helper.php
index 2d7d15f9d..8f05c5b18 100644
--- a/system/helpers/directory_helper.php
+++ b/system/helpers/directory_helper.php
@@ -99,6 +99,3 @@ if ( ! function_exists('directory_map'))
return FALSE;
}
}
-
-/* End of file directory_helper.php */
-/* Location: ./system/helpers/directory_helper.php */ \ No newline at end of file
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index a781a0c02..379120552 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -165,6 +165,3 @@ if ( ! function_exists('force_download'))
exit;
}
}
-
-/* End of file download_helper.php */
-/* Location: ./system/helpers/download_helper.php */ \ No newline at end of file
diff --git a/system/helpers/email_helper.php b/system/helpers/email_helper.php
index d7691e349..c4d705810 100644
--- a/system/helpers/email_helper.php
+++ b/system/helpers/email_helper.php
@@ -82,6 +82,3 @@ if ( ! function_exists('send_email'))
return mail($recipient, $subject, $message);
}
}
-
-/* End of file email_helper.php */
-/* Location: ./system/helpers/email_helper.php */ \ No newline at end of file
diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php
index 1ff728778..8b15e60a5 100644
--- a/system/helpers/file_helper.php
+++ b/system/helpers/file_helper.php
@@ -449,6 +449,3 @@ if ( ! function_exists('octal_permissions'))
return substr(sprintf('%o', $perms), -3);
}
}
-
-/* End of file file_helper.php */
-/* Location: ./system/helpers/file_helper.php */ \ No newline at end of file
diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php
index 0e9207ee2..fb235291e 100644
--- a/system/helpers/form_helper.php
+++ b/system/helpers/form_helper.php
@@ -100,7 +100,7 @@ if ( ! function_exists('form_open'))
{
foreach ($hidden as $name => $value)
{
- $form .= '<input type="hidden" name="'.$name.'" value="'.form_prep($value).'" style="display:none;" />'."\n";
+ $form .= '<input type="hidden" name="'.$name.'" value="'.html_escape($value).'" style="display:none;" />'."\n";
}
}
@@ -173,7 +173,7 @@ if ( ! function_exists('form_hidden'))
if ( ! is_array($value))
{
- $form .= '<input type="hidden" name="'.$name.'" value="'.form_prep($value)."\" />\n";
+ $form .= '<input type="hidden" name="'.$name.'" value="'.html_escape($value)."\" />\n";
}
else
{
@@ -287,7 +287,7 @@ if ( ! function_exists('form_textarea'))
unset($data['value']); // textareas don't use the value attribute
}
- return '<textarea '._parse_form_attributes($data, $defaults).$extra.'>'.form_prep($val, TRUE)."</textarea>\n";
+ return '<textarea '._parse_form_attributes($data, $defaults).$extra.'>'.html_escape($val)."</textarea>\n";
}
}
@@ -392,7 +392,7 @@ if ( ! function_exists('form_dropdown'))
foreach ($val as $optgroup_key => $optgroup_val)
{
$sel = in_array($optgroup_key, $selected) ? ' selected="selected"' : '';
- $form .= '<option value="'.form_prep($optgroup_key).'"'.$sel.'>'
+ $form .= '<option value="'.html_escape($optgroup_key).'"'.$sel.'>'
.(string) $optgroup_val."</option>\n";
}
@@ -400,7 +400,7 @@ if ( ! function_exists('form_dropdown'))
}
else
{
- $form .= '<option value="'.form_prep($key).'"'
+ $form .= '<option value="'.html_escape($key).'"'
.(in_array($key, $selected) ? ' selected="selected"' : '').'>'
.(string) $val."</option>\n";
}
@@ -653,28 +653,13 @@ if ( ! function_exists('form_prep'))
*
* Formats text so that it can be safely placed in a form field in the event it has HTML tags.
*
+ * @deprecated 3.0.0 An alias for html_escape()
* @param string|string[] $str Value to escape
- * @param bool $is_textarea Whether we're escaping for a textarea element
* @return string|string[] Escaped values
*/
- function form_prep($str = '', $is_textarea = FALSE)
+ function form_prep($str)
{
- if (is_array($str))
- {
- foreach (array_keys($str) as $key)
- {
- $str[$key] = form_prep($str[$key], $is_textarea);
- }
-
- return $str;
- }
-
- if ($is_textarea === TRUE)
- {
- return str_replace(array('<', '>'), array('&lt;', '&gt;'), stripslashes($str));
- }
-
- return str_replace(array("'", '"'), array('&#39;', '&quot;'), stripslashes($str));
+ return html_escape($str, TRUE);
}
}
@@ -691,10 +676,9 @@ if ( ! function_exists('set_value'))
*
* @param string $field Field name
* @param string $default Default value
- * @param bool $is_textarea Whether the field is a textarea element
* @return string
*/
- function set_value($field = '', $default = '', $is_textarea = FALSE)
+ function set_value($field, $default = '')
{
$CI =& get_instance();
@@ -702,7 +686,7 @@ if ( ! function_exists('set_value'))
? $CI->form_validation->set_value($field, $default)
: $CI->input->post($field, FALSE);
- return form_prep($value === NULL ? $default : $value, $is_textarea);
+ return html_escape($value === NULL ? $default : $value);
}
}
@@ -721,7 +705,7 @@ if ( ! function_exists('set_select'))
* @param bool
* @return string
*/
- function set_select($field = '', $value = '', $default = FALSE)
+ function set_select($field, $value = '', $default = FALSE)
{
$CI =& get_instance();
@@ -768,7 +752,7 @@ if ( ! function_exists('set_checkbox'))
* @param bool
* @return string
*/
- function set_checkbox($field = '', $value = '', $default = FALSE)
+ function set_checkbox($field, $value = '', $default = FALSE)
{
$CI =& get_instance();
@@ -815,7 +799,7 @@ if ( ! function_exists('set_radio'))
* @param bool $default
* @return string
*/
- function set_radio($field = '', $value = '', $default = FALSE)
+ function set_radio($field, $value = '', $default = FALSE)
{
$CI =& get_instance();
@@ -921,7 +905,7 @@ if ( ! function_exists('_parse_form_attributes'))
{
if ($key === 'value')
{
- $val = form_prep($val);
+ $val = html_escape($val);
}
elseif ($key === 'name' && ! strlen($default['name']))
{
@@ -1012,6 +996,3 @@ if ( ! function_exists('_get_validation_object'))
return $return;
}
}
-
-/* End of file form_helper.php */
-/* Location: ./system/helpers/form_helper.php */ \ No newline at end of file
diff --git a/system/helpers/html_helper.php b/system/helpers/html_helper.php
index daa380c15..28fbe00be 100644
--- a/system/helpers/html_helper.php
+++ b/system/helpers/html_helper.php
@@ -408,6 +408,3 @@ if ( ! function_exists('nbs'))
return str_repeat('&nbsp;', $num);
}
}
-
-/* End of file html_helper.php */
-/* Location: ./system/helpers/html_helper.php */ \ No newline at end of file
diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php
index 8ce671367..d8ed45df9 100644
--- a/system/helpers/inflector_helper.php
+++ b/system/helpers/inflector_helper.php
@@ -243,6 +243,3 @@ if ( ! function_exists('is_countable'))
);
}
}
-
-/* End of file inflector_helper.php */
-/* Location: ./system/helpers/inflector_helper.php */ \ No newline at end of file
diff --git a/system/helpers/language_helper.php b/system/helpers/language_helper.php
index ec448ad69..25ce8abe1 100644
--- a/system/helpers/language_helper.php
+++ b/system/helpers/language_helper.php
@@ -73,6 +73,3 @@ if ( ! function_exists('lang'))
return $line;
}
}
-
-/* End of file language_helper.php */
-/* Location: ./system/helpers/language_helper.php */ \ No newline at end of file
diff --git a/system/helpers/number_helper.php b/system/helpers/number_helper.php
index 50b6c44d7..3a24259e1 100644
--- a/system/helpers/number_helper.php
+++ b/system/helpers/number_helper.php
@@ -92,6 +92,3 @@ if ( ! function_exists('byte_format'))
return number_format($num, $precision).' '.$unit;
}
}
-
-/* End of file number_helper.php */
-/* Location: ./system/helpers/number_helper.php */ \ No newline at end of file
diff --git a/system/helpers/path_helper.php b/system/helpers/path_helper.php
index ecf61d29e..c23ec6435 100644
--- a/system/helpers/path_helper.php
+++ b/system/helpers/path_helper.php
@@ -80,6 +80,3 @@ if ( ! function_exists('set_realpath'))
return is_dir($path) ? rtrim($path, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR : $path;
}
}
-
-/* End of file path_helper.php */
-/* Location: ./system/helpers/path_helper.php */ \ No newline at end of file
diff --git a/system/helpers/security_helper.php b/system/helpers/security_helper.php
index fb0519272..adbf136bb 100644
--- a/system/helpers/security_helper.php
+++ b/system/helpers/security_helper.php
@@ -135,6 +135,3 @@ if ( ! function_exists('encode_php_tags'))
return str_replace(array('<?', '?>'), array('&lt;?', '?&gt;'), $str);
}
}
-
-/* End of file security_helper.php */
-/* Location: ./system/helpers/security_helper.php */ \ No newline at end of file
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php
index 164222c1d..d053dd22c 100644
--- a/system/helpers/smiley_helper.php
+++ b/system/helpers/smiley_helper.php
@@ -253,6 +253,3 @@ if ( ! function_exists('_get_smiley_array'))
return $_smileys;
}
}
-
-/* End of file smiley_helper.php */
-/* Location: ./system/helpers/smiley_helper.php */ \ No newline at end of file
diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php
index 5daae987c..5860e15fb 100644
--- a/system/helpers/string_helper.php
+++ b/system/helpers/string_helper.php
@@ -303,6 +303,3 @@ if ( ! function_exists('repeater'))
return ($num > 0) ? str_repeat($data, $num) : '';
}
}
-
-/* End of file string_helper.php */
-/* Location: ./system/helpers/string_helper.php */ \ No newline at end of file
diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php
index 3a1f11c21..f2290c895 100644
--- a/system/helpers/text_helper.php
+++ b/system/helpers/text_helper.php
@@ -547,6 +547,3 @@ if ( ! function_exists('ellipsize'))
return $beg.$ellipsis.$end;
}
}
-
-/* End of file text_helper.php */
-/* Location: ./system/helpers/text_helper.php */ \ No newline at end of file
diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php
index e5bfbc0b9..45bb9b1d4 100644
--- a/system/helpers/typography_helper.php
+++ b/system/helpers/typography_helper.php
@@ -102,6 +102,3 @@ if ( ! function_exists('entity_decode'))
return get_instance()->security->entity_decode($str, $charset);
}
}
-
-/* End of file typography_helper.php */
-/* Location: ./system/helpers/typography_helper.php */ \ No newline at end of file
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index afec35aea..bf623b000 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -567,6 +567,3 @@ if ( ! function_exists('redirect'))
exit;
}
}
-
-/* End of file url_helper.php */
-/* Location: ./system/helpers/url_helper.php */ \ No newline at end of file
diff --git a/system/helpers/xml_helper.php b/system/helpers/xml_helper.php
index e0b2f58f3..55f9c2f66 100644
--- a/system/helpers/xml_helper.php
+++ b/system/helpers/xml_helper.php
@@ -88,6 +88,3 @@ if ( ! function_exists('xml_convert'))
return $str;
}
}
-
-/* End of file xml_helper.php */
-/* Location: ./system/helpers/xml_helper.php */ \ No newline at end of file