summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
authorpurwandi <free6300@gmail.com>2011-09-08 14:02:08 +0200
committerpurwandi <free6300@gmail.com>2011-09-08 14:02:08 +0200
commita6529a2782d9f0942891dc9316f1e9955383f704 (patch)
tree67509b9a2b5cc28a2bfce6a3fde452d47f026559 /system
parente3bf976523e2c85fb942be1bba4deda068d55324 (diff)
parentbff3dfda42b58289c41f88342a0ab17846f52f3b (diff)
Merge branch 'develop' of https://github.com/EllisLab/CodeIgniter into develop
Diffstat (limited to 'system')
-rw-r--r--system/database/DB_active_rec.php4
-rw-r--r--system/helpers/string_helper.php9
2 files changed, 5 insertions, 8 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php
index 89766e304..7162e2ac5 100644
--- a/system/database/DB_active_rec.php
+++ b/system/database/DB_active_rec.php
@@ -872,11 +872,11 @@ class CI_DB_active_record extends CI_DB_driver {
* @param integer the offset value
* @return object
*/
- public function limit($value, $offset = '')
+ public function limit($value, $offset = NULL)
{
$this->ar_limit = (int) $value;
- if ($offset != '')
+ if ( ! is_null($offset))
{
$this->ar_offset = (int) $offset;
}
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' :