summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorPhil Sturgeon <email@philsturgeon.co.uk>2011-03-09 11:08:36 +0100
committerPhil Sturgeon <email@philsturgeon.co.uk>2011-03-09 11:08:36 +0100
commit93ca71552d9a3e28eeaa00dd10755d20b2cbf32e (patch)
tree660233f2ec631e5730731491d2fd244fe15f7df8 /system/helpers
parenta9924b8352aa18869677bea0182c45e2a7e2ce37 (diff)
parent2f8b27efeb0a39c24eddf89cf31ea0fd113a6b71 (diff)
Merged recent Core changes and fixed conflict.
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/captcha_helper.php2
-rw-r--r--system/helpers/cookie_helper.php4
-rw-r--r--system/helpers/file_helper.php2
-rw-r--r--system/helpers/inflector_helper.php2
-rw-r--r--system/helpers/language_helper.php2
-rw-r--r--system/helpers/number_helper.php2
-rw-r--r--system/helpers/smiley_helper.php4
-rw-r--r--system/helpers/text_helper.php19
8 files changed, 14 insertions, 23 deletions
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/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);
}
}
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/inflector_helper.php b/system/helpers/inflector_helper.php
index ed9ab5f9d..4cd7486b4 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';
}
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 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
diff --git a/system/helpers/number_helper.php b/system/helpers/number_helper.php
index a2caea5e3..611777559 100644
--- a/system/helpers/number_helper.php
+++ b/system/helpers/number_helper.php
@@ -1,4 +1,4 @@
-<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
diff --git a/system/helpers/smiley_helper.php b/system/helpers/smiley_helper.php
index 80a8d79ad..463881f58 100644
--- a/system/helpers/smiley_helper.php
+++ b/system/helpers/smiley_helper.php
@@ -59,7 +59,7 @@ if ( ! function_exists('smiley_js'))
if (is_array($alias))
{
- foreach($alias as $name => $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 e1b56c9c9..96afd4cee 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);
}
}
@@ -452,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))