summaryrefslogtreecommitdiffstats
path: root/system/helpers/string_helper.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@bofh.bg>2012-03-26 21:08:49 +0200
committerAndrey Andreev <narf@bofh.bg>2012-03-26 21:08:49 +0200
commit1a361209cf77133d2a38132cebe1db17df04a7d4 (patch)
tree9132215eecd4fae44e6dd3e24f5928b8a5d3cad9 /system/helpers/string_helper.php
parent7fd46308949522f1c7c8853381c2ce7cea093c9a (diff)
parent5bc7a2393187a25f832f18552dbdb8defb23e9d1 (diff)
Merge upstream branch
Diffstat (limited to 'system/helpers/string_helper.php')
-rw-r--r--system/helpers/string_helper.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php
index e570d5d01..a6a6b485d 100644
--- a/system/helpers/string_helper.php
+++ b/system/helpers/string_helper.php
@@ -192,7 +192,8 @@ if ( ! function_exists('random_string'))
{
switch ($type)
{
- case 'basic': return mt_rand();
+ case 'basic':
+ return mt_rand();
case 'alnum':
case 'numeric':
case 'nozero':
@@ -214,12 +215,11 @@ if ( ! function_exists('random_string'))
}
return substr(str_shuffle(str_repeat($pool, ceil($len / strlen($pool)))), 0, $len);
case 'unique':
- case 'md5': return md5(uniqid(mt_rand()));
+ case 'md5':
+ return md5(uniqid(mt_rand()));
case 'encrypt':
case 'sha1':
- $CI =& get_instance();
- $CI->load->helper('security');
- return do_hash(uniqid(mt_rand(), TRUE), 'sha1');
+ return sha1(uniqid(mt_rand(), TRUE));
}
}
}
@@ -229,9 +229,9 @@ if ( ! function_exists('random_string'))
/**
* Add's _1 to a string or increment the ending number to allow _2, _3, etc
*
- * @param string $str required
- * @param string $separator What should the duplicate number be appended with
- * @param string $first Which number should be used for the first dupe increment
+ * @param string required
+ * @param string What should the duplicate number be appended with
+ * @param string Which number should be used for the first dupe increment
* @return string
*/
if ( ! function_exists('increment_string'))