summaryrefslogtreecommitdiffstats
path: root/system/helpers/string_helper.php
diff options
context:
space:
mode:
authorDarren Hill <dchill42@gmail.com>2011-09-12 13:57:04 +0200
committerDarren Hill <dchill42@gmail.com>2011-09-12 13:57:04 +0200
commit00fcb545109d4e61bc14e403ec828749c34a54b3 (patch)
tree336473d0e3a85ce90cc463784f631c3d52462605 /system/helpers/string_helper.php
parent826675178c2c2ad697e5ac55161645abd9143bef (diff)
parent869e3721d75e9798a706d24d93170f44e5ab6cb3 (diff)
Updated cookie driver to latest develop changes
Diffstat (limited to 'system/helpers/string_helper.php')
-rw-r--r--system/helpers/string_helper.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/system/helpers/string_helper.php b/system/helpers/string_helper.php
index 9fa69f46c..dd8ffaddb 100644
--- a/system/helpers/string_helper.php
+++ b/system/helpers/string_helper.php
@@ -215,12 +215,9 @@ if ( ! function_exists('random_string'))
case 'nozero' : $pool = '123456789';
break;
}
-
- $str = '';
- for ($i=0; $i < $len; $i++)
- {
- $str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
- }
+
+ $str = substr(str_shuffle(str_repeat($pool, ceil($len/strlen($pool)))),0,$len);
+
return $str;
break;
case 'unique' :