diff options
author | Darren Hill <dchill42@gmail.com> | 2011-09-12 13:57:04 +0200 |
---|---|---|
committer | Darren Hill <dchill42@gmail.com> | 2011-09-12 13:57:04 +0200 |
commit | 00fcb545109d4e61bc14e403ec828749c34a54b3 (patch) | |
tree | 336473d0e3a85ce90cc463784f631c3d52462605 /system | |
parent | 826675178c2c2ad697e5ac55161645abd9143bef (diff) | |
parent | 869e3721d75e9798a706d24d93170f44e5ab6cb3 (diff) |
Updated cookie driver to latest develop changes
Diffstat (limited to 'system')
-rw-r--r-- | system/database/DB_active_rec.php | 6 | ||||
-rw-r--r-- | system/helpers/string_helper.php | 9 | ||||
-rw-r--r-- | system/language/english/migration_lang.php | 2 | ||||
-rw-r--r-- | system/libraries/Profiler.php | 2 | ||||
-rwxr-xr-x | system/libraries/Session/drivers/Session_cookie.php | 21 | ||||
-rwxr-xr-x | system/libraries/Session/drivers/Session_native.php | 2 |
6 files changed, 21 insertions, 21 deletions
diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 37d162bc1..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; } @@ -894,7 +894,7 @@ class CI_DB_active_record extends CI_DB_driver { */ public function offset($offset) { - $this->ar_offset = $offset; + $this->ar_offset = (int) $offset; return $this; } 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' : diff --git a/system/language/english/migration_lang.php b/system/language/english/migration_lang.php index 4763ca243..94cb882fb 100644 --- a/system/language/english/migration_lang.php +++ b/system/language/english/migration_lang.php @@ -5,7 +5,7 @@ $lang['migration_not_found'] = "This migration could not be found."; $lang['migration_multiple_version'] = "This are multiple migrations with the same version number: %d."; $lang['migration_class_doesnt_exist'] = "The migration class \"%s\" could not be found."; $lang['migration_missing_up_method'] = "The migration class \"%s\" is missing an 'up' method."; -$lang['migration_missing_down_method'] = "The migration class \"%s\" is missing an 'up' method."; +$lang['migration_missing_down_method'] = "The migration class \"%s\" is missing a 'down' method."; $lang['migration_invalid_filename'] = "Migration \"%s\" has an invalid filename."; diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 330acce73..ac58129a9 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -506,7 +506,7 @@ class CI_Profiler { foreach ($this->CI->session->all_userdata() as $key => $val) { - if (is_array($val)) + if (is_array($val) || is_object($val)) { $val = print_r($val, TRUE); } diff --git a/system/libraries/Session/drivers/Session_cookie.php b/system/libraries/Session/drivers/Session_cookie.php index 334218ec2..696105bc6 100755 --- a/system/libraries/Session/drivers/Session_cookie.php +++ b/system/libraries/Session/drivers/Session_cookie.php @@ -28,21 +28,22 @@ */ class CI_Session_cookie extends CI_Session_driver { protected $sess_encrypt_cookie = FALSE; - protected $sess_use_database = FALSE; + protected $sess_use_database = FALSE; protected $sess_table_name = ''; protected $sess_expiration = 7200; protected $sess_expire_on_close = FALSE; - protected $sess_match_ip = FALSE; + protected $sess_match_ip = FALSE; protected $sess_match_useragent = TRUE; protected $sess_cookie_name = 'ci_session'; - protected $cookie_prefix = ''; + protected $cookie_prefix = ''; protected $cookie_path = ''; - protected $cookie_domain = ''; + protected $cookie_domain = ''; + protected $cookie_secure = FALSE; protected $sess_time_to_update = 300; - protected $encryption_key = ''; - protected $time_reference = 'time'; + protected $encryption_key = ''; + protected $time_reference = 'time'; protected $userdata = array(); - protected $CI = null; + protected $CI = null; protected $now = 0; const gc_probability = 5; @@ -62,7 +63,8 @@ class CI_Session_cookie extends CI_Session_driver { // manually via the $params array above or via the config file foreach (array('sess_encrypt_cookie', 'sess_use_database', 'sess_table_name', 'sess_expiration', 'sess_expire_on_close', 'sess_match_ip', 'sess_match_useragent', 'sess_cookie_name', 'cookie_path', - 'cookie_domain', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') as $key) + 'cookie_domain', 'cookie_secure', 'sess_time_to_update', 'time_reference', 'cookie_prefix', 'encryption_key') + as $key) { $this->$key = (isset($this->parent->params[$key])) ? $this->parent->params[$key] : $this->CI->config->item($key); } @@ -482,7 +484,8 @@ class CI_Session_cookie extends CI_Session_driver { $expire = ($this->sess_expire_on_close === TRUE) ? 0 : $this->sess_expiration + time(); // Set the cookie - setcookie($this->sess_cookie_name, $cookie_data, $expire, $this->cookie_path, $this->cookie_domain, 0); + setcookie($this->sess_cookie_name, $cookie_data, $expire, $this->cookie_path, $this->cookie_domain, + $this->cookie_secure); } /** diff --git a/system/libraries/Session/drivers/Session_native.php b/system/libraries/Session/drivers/Session_native.php index c7130b688..09fb7f999 100755 --- a/system/libraries/Session/drivers/Session_native.php +++ b/system/libraries/Session/drivers/Session_native.php @@ -22,7 +22,7 @@ * @package CodeIgniter * @subpackage Libraries * @category Sessions - * @author ExpressionEngine Dev Team + * @author ExpressionEngine Dev Team */ class CI_Session_native extends CI_Session_driver { /** |