From 7b3be2fbcf62791918be5fe6d5c42eb005eb7342 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 11 Jan 2011 08:52:09 -0500 Subject: Changed || to OR to match coding standards --- system/helpers/inflector_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/helpers') diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index 3d9acfcf0..88f48d48e 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -93,7 +93,7 @@ if ( ! function_exists('plural')) } elseif ($end == 'h') { - if (substr($str, -2) == 'ch' || substr($str, -2) == 'sh') + if (substr($str, -2) == 'ch' OR substr($str, -2) == 'sh') { $str .= 'es'; } -- cgit v1.2.3-24-g4f1b From 5e04480e5a4dd1b9b639eca54f5f3adbd0b39039 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 11 Jan 2011 16:10:26 -0500 Subject: Reworked convert_foreign_characters in text helper. Thanks to Mario Ricalde. --- system/helpers/text_helper.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 58b08aaf8..9194b577d 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -364,30 +364,21 @@ if ( ! function_exists('highlight_phrase')) */ if ( ! function_exists('convert_accented_characters')) { - function convert_accented_characters($match) + function convert_accented_characters($str) { if ( ! file_exists(APPPATH.'config/foreign_chars'.EXT)) { - return $match; + return $str; } include APPPATH.'config/foreign_chars'.EXT; if ( ! isset($foreign_characters)) { - return $match; + return $str; } - $ord = ord($match['1']); - - if (isset($foreign_characters[$ord])) - { - return $foreign_characters[$ord]; - } - else - { - return $match['1']; - } + return preg_replace(array_keys($foreign_characters), array_values($foreign_characters), $str); } } -- cgit v1.2.3-24-g4f1b From 45e3cdf52d7438c5a6adf70835d96cfeab1eea0e Mon Sep 17 00:00:00 2001 From: Pascal Kriete Date: Mon, 14 Feb 2011 13:26:20 -0500 Subject: Whitespace cleanup for code consistency --- system/helpers/captcha_helper.php | 2 +- system/helpers/file_helper.php | 2 +- system/helpers/language_helper.php | 2 +- system/helpers/number_helper.php | 2 +- system/helpers/smiley_helper.php | 4 ++-- system/helpers/text_helper.php | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/captcha_helper.php b/system/helpers/captcha_helper.php index c0e3798f4..19ec0c778 100644 --- a/system/helpers/captcha_helper.php +++ b/system/helpers/captcha_helper.php @@ -87,7 +87,7 @@ if ( ! function_exists('create_captcha')) $current_dir = @opendir($img_path); - while($filename = @readdir($current_dir)) + while ($filename = @readdir($current_dir)) { if ($filename != "." and $filename != ".." and $filename != "index.html") { diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 334eef87c..9518e4843 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -128,7 +128,7 @@ if ( ! function_exists('delete_files')) return FALSE; } - while(FALSE !== ($filename = @readdir($current_dir))) + while (FALSE !== ($filename = @readdir($current_dir))) { if ($filename != "." and $filename != "..") { diff --git a/system/helpers/language_helper.php b/system/helpers/language_helper.php index 68c1a1fc6..ac0d69da1 100644 --- a/system/helpers/language_helper.php +++ b/system/helpers/language_helper.php @@ -1,4 +1,4 @@ - $id) + foreach ($alias as $name => $id) { $m[] = '"'.$name.'" : "'.$id.'"'; } @@ -101,7 +101,7 @@ EOF; { if (is_array($alias)) { - foreach($alias as $name => $id) + foreach ($alias as $name => $id) { $r .= 'smiley_map["'.$name.'"] = "'.$id.'";'."\n"; } diff --git a/system/helpers/text_helper.php b/system/helpers/text_helper.php index 47e6ccc93..96afd4cee 100644 --- a/system/helpers/text_helper.php +++ b/system/helpers/text_helper.php @@ -443,7 +443,7 @@ if ( ! function_exists('word_wrap')) } $temp = ''; - while((strlen($line)) > $charlim) + while ((strlen($line)) > $charlim) { // If the over-length word is a URL we won't wrap it if (preg_match("!\[url.+\]|://|wwww.!", $line)) -- cgit v1.2.3-24-g4f1b From d8d1e24eee56d2466c91ecd72b3c8932eb3d0639 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Wed, 16 Feb 2011 17:23:16 +0000 Subject: Secure cookies can now be made with the set_cookie() helper and Input Class method. --- system/helpers/cookie_helper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'system/helpers') diff --git a/system/helpers/cookie_helper.php b/system/helpers/cookie_helper.php index 7701d503f..7cee02827 100644 --- a/system/helpers/cookie_helper.php +++ b/system/helpers/cookie_helper.php @@ -44,11 +44,11 @@ */ if ( ! function_exists('set_cookie')) { - function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '') + function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE) { // Set the config file options $CI =& get_instance(); - $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix); + $CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure); } } -- cgit v1.2.3-24-g4f1b