From 95311be467faa2e744bbd9e932900a7cf96b081f Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sat, 20 Aug 2011 17:35:22 +0100 Subject: Renamed some Session library functions to make them shorter. Includes backwards compatibility. --- system/libraries/Cart.php | 10 ++++---- system/libraries/Session.php | 59 +++++++++++++++++++++++++++++++++----------- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index b2eaa9ad7..1caef49cd 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -59,9 +59,9 @@ class CI_Cart { $this->CI->load->library('session', $config); // Grab the shopping cart array from the session table, if it exists - if ($this->CI->session->userdata('cart_contents') !== FALSE) + if ($this->CI->session->get('cart_contents') !== FALSE) { - $this->_cart_contents = $this->CI->session->userdata('cart_contents'); + $this->_cart_contents = $this->CI->session->get('cart_contents'); } else { @@ -397,7 +397,7 @@ class CI_Cart { // Is our cart empty? If so we delete it from the session if (count($this->_cart_contents) <= 2) { - $this->CI->session->unset_userdata('cart_contents'); + $this->CI->session->rm('cart_contents'); // Nothing more to do... coffee time! return FALSE; @@ -405,7 +405,7 @@ class CI_Cart { // If we made it this far it means that our cart has data. // Let's pass it to the Session class so it can be stored - $this->CI->session->set_userdata(array('cart_contents' => $this->_cart_contents)); + $this->CI->session->set(array('cart_contents' => $this->_cart_contents)); // Woot! return TRUE; @@ -541,7 +541,7 @@ class CI_Cart { $this->_cart_contents['cart_total'] = 0; $this->_cart_contents['total_items'] = 0; - $this->CI->session->unset_userdata('cart_contents'); + $this->CI->session->rm('cart_contents'); } diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 2c8a80163..3203468b2 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -395,7 +395,7 @@ class CI_Session { * @access public * @return void */ - function sess_destroy() + function destroy() { // Kill the session DB row if ($this->sess_use_database === TRUE AND isset($this->userdata['session_id'])) @@ -424,7 +424,7 @@ class CI_Session { * @param string * @return string */ - function userdata($item) + function get($item) { return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item]; } @@ -437,7 +437,7 @@ class CI_Session { * @access public * @return array */ - function all_userdata() + function get_all() { return $this->userdata; } @@ -452,7 +452,7 @@ class CI_Session { * @param string * @return void */ - function set_userdata($newdata = array(), $newval = '') + function set($newdata = array(), $newval = '') { if (is_string($newdata)) { @@ -478,7 +478,7 @@ class CI_Session { * @access array * @return void */ - function unset_userdata($newdata = array()) + function rm($newdata = array()) { if (is_string($newdata)) { @@ -519,7 +519,7 @@ class CI_Session { foreach ($newdata as $key => $val) { $flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set_userdata($flashdata_key, $val); + $this->set($flashdata_key, $val); } } } @@ -540,10 +540,10 @@ class CI_Session { // Note the function will return FALSE if the $key // provided cannot be found $old_flashdata_key = $this->flashdata_key.':old:'.$key; - $value = $this->userdata($old_flashdata_key); + $value = $this->get($old_flashdata_key); $new_flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set_userdata($new_flashdata_key, $value); + $this->set($new_flashdata_key, $value); } // ------------------------------------------------------------------------ @@ -558,7 +558,7 @@ class CI_Session { function flashdata($key) { $flashdata_key = $this->flashdata_key.':old:'.$key; - return $this->userdata($flashdata_key); + return $this->get($flashdata_key); } // ------------------------------------------------------------------------ @@ -572,15 +572,15 @@ class CI_Session { */ function _flashdata_mark() { - $userdata = $this->all_userdata(); + $userdata = $this->get_all(); foreach ($userdata as $name => $value) { $parts = explode(':new:', $name); if (is_array($parts) && count($parts) === 2) { $new_name = $this->flashdata_key.':old:'.$parts[1]; - $this->set_userdata($new_name, $value); - $this->unset_userdata($name); + $this->set($new_name, $value); + $this->unset($name); } } } @@ -596,12 +596,12 @@ class CI_Session { function _flashdata_sweep() { - $userdata = $this->all_userdata(); + $userdata = $this->get_all(); foreach ($userdata as $key => $value) { if (strpos($key, ':old:')) { - $this->unset_userdata($key); + $this->unset($key); } } @@ -767,6 +767,37 @@ class CI_Session { log_message('debug', 'Session garbage collection performed.'); } } + + // -------------------------------------------------------------------- + + /** + * Backwards compatible functions + */ + + function userdata($item) + { + return $this->get($item); + } + + function all_userdata() + { + return $this->get_all(); + } + + function set_userdata($newdata) + { + $this->set($newdata); + } + + function unset_userdata($newdata) + { + $this->rm($newdata); + } + + function sess_destroy() + { + $this->destroy(); + } } -- cgit v1.2.3-24-g4f1b From 75bc58b05cf16a0f8c5e7ed1545033a5d8b8feba Mon Sep 17 00:00:00 2001 From: David Behler Date: Sun, 21 Aug 2011 15:03:47 +0200 Subject: Fixed problem with needless seperator at begin/end of string --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 system/helpers/url_helper.php diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php old mode 100644 new mode 100755 index d0516cee6..0431e0b4b --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -509,7 +509,7 @@ if ( ! function_exists('url_title')) $str = strtolower($str); } - return trim(stripslashes($str)); + return trim(trim(stripslashes($str)), $replace); } } -- cgit v1.2.3-24-g4f1b From a1a8ef711ec179a183a32f6cf4502ddc48782a84 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sun, 21 Aug 2011 15:44:10 +0100 Subject: Revert 43194ea1af658914a89ca49aed4dca4617b9c4ff^..HEAD --- system/libraries/Cart.php | 10 ++++---- system/libraries/Session.php | 59 +++++++++++--------------------------------- 2 files changed, 19 insertions(+), 50 deletions(-) diff --git a/system/libraries/Cart.php b/system/libraries/Cart.php index 1caef49cd..b2eaa9ad7 100644 --- a/system/libraries/Cart.php +++ b/system/libraries/Cart.php @@ -59,9 +59,9 @@ class CI_Cart { $this->CI->load->library('session', $config); // Grab the shopping cart array from the session table, if it exists - if ($this->CI->session->get('cart_contents') !== FALSE) + if ($this->CI->session->userdata('cart_contents') !== FALSE) { - $this->_cart_contents = $this->CI->session->get('cart_contents'); + $this->_cart_contents = $this->CI->session->userdata('cart_contents'); } else { @@ -397,7 +397,7 @@ class CI_Cart { // Is our cart empty? If so we delete it from the session if (count($this->_cart_contents) <= 2) { - $this->CI->session->rm('cart_contents'); + $this->CI->session->unset_userdata('cart_contents'); // Nothing more to do... coffee time! return FALSE; @@ -405,7 +405,7 @@ class CI_Cart { // If we made it this far it means that our cart has data. // Let's pass it to the Session class so it can be stored - $this->CI->session->set(array('cart_contents' => $this->_cart_contents)); + $this->CI->session->set_userdata(array('cart_contents' => $this->_cart_contents)); // Woot! return TRUE; @@ -541,7 +541,7 @@ class CI_Cart { $this->_cart_contents['cart_total'] = 0; $this->_cart_contents['total_items'] = 0; - $this->CI->session->rm('cart_contents'); + $this->CI->session->unset_userdata('cart_contents'); } diff --git a/system/libraries/Session.php b/system/libraries/Session.php index 3203468b2..2c8a80163 100644 --- a/system/libraries/Session.php +++ b/system/libraries/Session.php @@ -395,7 +395,7 @@ class CI_Session { * @access public * @return void */ - function destroy() + function sess_destroy() { // Kill the session DB row if ($this->sess_use_database === TRUE AND isset($this->userdata['session_id'])) @@ -424,7 +424,7 @@ class CI_Session { * @param string * @return string */ - function get($item) + function userdata($item) { return ( ! isset($this->userdata[$item])) ? FALSE : $this->userdata[$item]; } @@ -437,7 +437,7 @@ class CI_Session { * @access public * @return array */ - function get_all() + function all_userdata() { return $this->userdata; } @@ -452,7 +452,7 @@ class CI_Session { * @param string * @return void */ - function set($newdata = array(), $newval = '') + function set_userdata($newdata = array(), $newval = '') { if (is_string($newdata)) { @@ -478,7 +478,7 @@ class CI_Session { * @access array * @return void */ - function rm($newdata = array()) + function unset_userdata($newdata = array()) { if (is_string($newdata)) { @@ -519,7 +519,7 @@ class CI_Session { foreach ($newdata as $key => $val) { $flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set($flashdata_key, $val); + $this->set_userdata($flashdata_key, $val); } } } @@ -540,10 +540,10 @@ class CI_Session { // Note the function will return FALSE if the $key // provided cannot be found $old_flashdata_key = $this->flashdata_key.':old:'.$key; - $value = $this->get($old_flashdata_key); + $value = $this->userdata($old_flashdata_key); $new_flashdata_key = $this->flashdata_key.':new:'.$key; - $this->set($new_flashdata_key, $value); + $this->set_userdata($new_flashdata_key, $value); } // ------------------------------------------------------------------------ @@ -558,7 +558,7 @@ class CI_Session { function flashdata($key) { $flashdata_key = $this->flashdata_key.':old:'.$key; - return $this->get($flashdata_key); + return $this->userdata($flashdata_key); } // ------------------------------------------------------------------------ @@ -572,15 +572,15 @@ class CI_Session { */ function _flashdata_mark() { - $userdata = $this->get_all(); + $userdata = $this->all_userdata(); foreach ($userdata as $name => $value) { $parts = explode(':new:', $name); if (is_array($parts) && count($parts) === 2) { $new_name = $this->flashdata_key.':old:'.$parts[1]; - $this->set($new_name, $value); - $this->unset($name); + $this->set_userdata($new_name, $value); + $this->unset_userdata($name); } } } @@ -596,12 +596,12 @@ class CI_Session { function _flashdata_sweep() { - $userdata = $this->get_all(); + $userdata = $this->all_userdata(); foreach ($userdata as $key => $value) { if (strpos($key, ':old:')) { - $this->unset($key); + $this->unset_userdata($key); } } @@ -767,37 +767,6 @@ class CI_Session { log_message('debug', 'Session garbage collection performed.'); } } - - // -------------------------------------------------------------------- - - /** - * Backwards compatible functions - */ - - function userdata($item) - { - return $this->get($item); - } - - function all_userdata() - { - return $this->get_all(); - } - - function set_userdata($newdata) - { - $this->set($newdata); - } - - function unset_userdata($newdata) - { - $this->rm($newdata); - } - - function sess_destroy() - { - $this->destroy(); - } } -- cgit v1.2.3-24-g4f1b From aeb2c3e532e78be9ac78ba6fd4a305b7be31d2ab Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sun, 21 Aug 2011 16:14:54 +0100 Subject: Added new config parameter "csrf_exclude_uris" which allows for URIs to be whitelisted from CSRF verification. Fixes #149 --- application/config/config.php | 2 ++ system/core/Security.php | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/application/config/config.php b/application/config/config.php index 1ec65435e..b64b11669 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -292,11 +292,13 @@ $config['global_xss_filtering'] = FALSE; | 'csrf_token_name' = The token name | 'csrf_cookie_name' = The cookie name | 'csrf_expire' = The number in seconds the token should expire. +| 'csrf_exclude_uris' = Array of URIs which ignore CSRF checks */ $config['csrf_protection'] = FALSE; $config['csrf_token_name'] = 'csrf_test_name'; $config['csrf_cookie_name'] = 'csrf_cookie_name'; $config['csrf_expire'] = 7200; +$config['csrf_exclude_uris'] = array(); /* |-------------------------------------------------------------------------- diff --git a/system/core/Security.php b/system/core/Security.php index 3617cadcc..efd30eb14 100644 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -93,6 +93,16 @@ class CI_Security { { return $this->csrf_set_cookie(); } + + // Check if URI has been whitelisted from CSRF checks + if ($exclude_uris = config_item('csrf_exclude_uris')) + { + $uri = load_class('URI', 'core'); + if (in_array($uri->uri_string(), $exclude_uris)) + { + return $this; + } + } // Do the tokens exist in both the _POST and _COOKIE arrays? if ( ! isset($_POST[$this->_csrf_token_name]) OR @@ -116,7 +126,7 @@ class CI_Security { $this->_csrf_set_hash(); $this->csrf_set_cookie(); - log_message('debug', "CSRF token verified "); + log_message('debug', "CSRF token verified"); return $this; } -- cgit v1.2.3-24-g4f1b From 87c74c885991075cf42e9e78d7843290e2b0c3a7 Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Sun, 21 Aug 2011 16:28:43 +0100 Subject: Updated Security library documentation with details on how to whitelist URIs from CSRF protection --- user_guide/libraries/security.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/user_guide/libraries/security.html b/user_guide/libraries/security.html index dd62a4386..cbe12d852 100644 --- a/user_guide/libraries/security.html +++ b/user_guide/libraries/security.html @@ -116,6 +116,9 @@ Note: This function should only be used to deal with data upon submission. It's

If you use the form helper the form_open() function will automatically insert a hidden csrf field in your forms.

+

Select URIs can be whitelisted from csrf protection (for example API endpoints expecting externally POSTed content). You can add these URIs by editing the 'csrf_exclude_uris' config parameter:

+$config['csrf_exclude_uris'] = array('api/person/add'); + -- cgit v1.2.3-24-g4f1b From 52c10b68c275248eb7e12ec1d039876cd5f81f11 Mon Sep 17 00:00:00 2001 From: John Bellone Date: Sun, 21 Aug 2011 11:41:32 -0400 Subject: Making changes to stop remote spoofing --- system/core/Input.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/core/Input.php b/system/core/Input.php index cfbef942d..365f779de 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -287,13 +287,13 @@ class CI_Input { $this->ip_address = in_array($_SERVER['REMOTE_ADDR'], $proxies) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; } - elseif ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP')) + elseif ($this->server('REMOTE_ADDR') AND ! $this->server('HTTP_CLIENT_IP')) { - $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; + $this->ip_address = $_SERVER['REMOTE_ADDR']; } - elseif ($this->server('REMOTE_ADDR')) + elseif ($this->server('REMOTE_ADDR') AND $this->server('HTTP_CLIENT_IP')) { - $this->ip_address = $_SERVER['REMOTE_ADDR']; + $this->ip_address = $_SERVER['HTTP_CLIENT_IP']; } elseif ($this->server('HTTP_CLIENT_IP')) { -- cgit v1.2.3-24-g4f1b From 16f27b402049dc2ff0cc09faf4885aee944ba639 Mon Sep 17 00:00:00 2001 From: John Bellone Date: Sun, 21 Aug 2011 11:45:11 -0400 Subject: Changed order --- system/core/Input.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/Input.php b/system/core/Input.php index 365f779de..df9d2a5b7 100644 --- a/system/core/Input.php +++ b/system/core/Input.php @@ -287,7 +287,7 @@ class CI_Input { $this->ip_address = in_array($_SERVER['REMOTE_ADDR'], $proxies) ? $_SERVER['HTTP_X_FORWARDED_FOR'] : $_SERVER['REMOTE_ADDR']; } - elseif ($this->server('REMOTE_ADDR') AND ! $this->server('HTTP_CLIENT_IP')) + elseif (! $this->server('HTTP_CLIENT_IP') AND $this->server('REMOTE_ADDR')) { $this->ip_address = $_SERVER['REMOTE_ADDR']; } -- cgit v1.2.3-24-g4f1b From 1e4276da338741e63de4701e5cdba611953fe024 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Sun, 21 Aug 2011 15:46:24 -0400 Subject: Added changelog to last commit. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 15872c1ac..e2df11b86 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -72,6 +72,7 @@ Change Log
  • Added increment_string() to String Helper to turn "foo" into "foo-1" or "foo-1" into "foo-2".
  • Altered form helper - made action on form_open_multipart helper function call optional. Fixes (#65)
  • +
  • url_title() will now trim extra dashes from beginning and end.
  • Database -- cgit v1.2.3-24-g4f1b From ab57a3520eafacaf2f130b3f4778a57a632fac1c Mon Sep 17 00:00:00 2001 From: Shane Pearson Date: Mon, 22 Aug 2011 16:11:20 -0500 Subject: Fix #8 - Load core classes from the application folder first. --- system/core/Common.php | 6 +++--- user_guide/changelog.html | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/system/core/Common.php b/system/core/Common.php index db9fbeb9f..3c62403ac 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -132,9 +132,9 @@ if ( ! function_exists('load_class')) $name = FALSE; - // Look for the class first in the native system/libraries folder - // thenin the local application/libraries folder - foreach (array(BASEPATH, APPPATH) as $path) + // Look for the class first in the local application/libraries folder + // then in the native system/libraries folder + foreach (array(APPPATH, BASEPATH) as $path) { if (file_exists($path.$directory.'/'.$class.'.php')) { diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9d8fd2b54..e5501abbc 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -105,6 +105,7 @@ Change Log
  • Fixed a bug (#181) where a mis-spelling was in the form validation language file.
  • Fixed a bug (#160) - Removed unneeded array copy in the file cache driver.
  • Fixed a bug (#150) - field_data() now correctly returns column length.
  • +
  • Fixed a bug (#8) - Look for core classes in APPPATH first.
  • Version 2.0.3

    -- cgit v1.2.3-24-g4f1b From 48705c3345cf115910dbaa798f60288ea7b9ca36 Mon Sep 17 00:00:00 2001 From: Shane Pearson Date: Mon, 22 Aug 2011 16:17:32 -0500 Subject: updated changelog message --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e5501abbc..4c207d6bc 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -105,7 +105,7 @@ Change Log
  • Fixed a bug (#181) where a mis-spelling was in the form validation language file.
  • Fixed a bug (#160) - Removed unneeded array copy in the file cache driver.
  • Fixed a bug (#150) - field_data() now correctly returns column length.
  • -
  • Fixed a bug (#8) - Look for core classes in APPPATH first.
  • +
  • Fixed a bug (#8) - load_class() now looks for core classes in APPPATH first, allowing them to be replaced.
  • Version 2.0.3

    -- cgit v1.2.3-24-g4f1b From 665baec264c04fb3284e313d59e102b2bf041e37 Mon Sep 17 00:00:00 2001 From: Shane Pearson Date: Mon, 22 Aug 2011 18:52:19 -0500 Subject: make _ci_autoloader() protected so it can be properly extended. --- system/core/Loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/Loader.php b/system/core/Loader.php index 452dc0b4c..de0fc06d2 100755 --- a/system/core/Loader.php +++ b/system/core/Loader.php @@ -1106,7 +1106,7 @@ class CI_Loader { * @param array * @return void */ - private function _ci_autoloader() + protected function _ci_autoloader() { if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/autoload.php')) { -- cgit v1.2.3-24-g4f1b From e77c6117e473900ca35ec7993f4159179d5b5f9c Mon Sep 17 00:00:00 2001 From: Shane Pearson Date: Mon, 22 Aug 2011 19:01:28 -0500 Subject: add a note to the changelog about _ci_autloader() --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9d8fd2b54..ac936a68c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -91,6 +91,7 @@ Change Log
  • Added a Migration Library to assist with applying incremental updates to your database schema.
  • Driver children can be located in any package path.
  • Added max_filename_increment config setting for Upload library.
  • +
  • CI_Loader::_ci_autoloader() is now a protected method.
  • -- cgit v1.2.3-24-g4f1b From c51a435968eda164dc5d055ff9ec15918a6f56ab Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 23 Aug 2011 10:40:39 +0800 Subject: Update: User Guide error on upgrade_203.html file --- user_guide/installation/upgrade_203.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/installation/upgrade_203.html b/user_guide/installation/upgrade_203.html index 1d37a055d..04899832d 100644 --- a/user_guide/installation/upgrade_203.html +++ b/user_guide/installation/upgrade_203.html @@ -81,7 +81,7 @@ Upgrading from 2.0.2 to 2.0.3

    Step 5: Remove APPPATH.'third_party' from autoload.php

    -

    Open application/autoload.php, and look for the following:

    +

    Open application/config/autoload.php, and look for the following:

    $autoload['packages'] = array(APPPATH.'third_party'); -- cgit v1.2.3-24-g4f1b From f31895096e821c694670b62180b7a5c309b62a9b Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 23 Aug 2011 21:40:59 -0400 Subject: Changed doc block options. Fixes #100 --- system/helpers/url_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 9f4b85248..09d975621 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -527,7 +527,7 @@ if ( ! function_exists('url_title')) * * @access public * @param string the URL - * @param string the method: location or redirect + * @param string the method: location or refresh * @return string */ if ( ! function_exists('redirect')) -- cgit v1.2.3-24-g4f1b From 45c887bb99b537a2b191a1fe476752dc5a8527d7 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Tue, 23 Aug 2011 21:53:35 -0400 Subject: Added readme for github project page --- readme.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 000000000..599fdb3cf --- /dev/null +++ b/readme.md @@ -0,0 +1,10 @@ +# What is CodeIgniter + +CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. Its goal is to enable you to develop projects much faster than you could if you were writing code from scratch, by providing a rich set of libraries for commonly needed tasks, as well as a simple interface and logical structure to access these libraries. CodeIgniter lets you creatively focus on your project by minimizing the amount of code needed for a given task. + +# Resources + + * [User Guide](http://codeigniter.com/user_guide/) + * [Community Forums](http://codeigniter.com/forums/) + * [Community Wiki](http://codeigniter.com/wiki/) + * [Community IRC](http://webchat.freenode.net/?channels=codeigniter&uio=d4)] \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 17e7b44e4b67e8d36ef6a0f8f08c2751fce3b55b Mon Sep 17 00:00:00 2001 From: Kevin Hoogheem Date: Tue, 23 Aug 2011 22:48:48 -0500 Subject: MIME Type Adds/Changes Updated MIME Types with certs and new audio/video files as well as added extra types for some existing files. --- application/config/mimes.php | 50 +++++++++++++++++++++++++++++++++++++------- user_guide/changelog.html | 5 +++++ 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/application/config/mimes.php b/application/config/mimes.php index 82767d7c8..be9a67842 100644 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -8,10 +8,10 @@ | */ -$mimes = array( 'hqx' => 'application/mac-binhex40', +$mimes = array( 'hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'), 'cpt' => 'application/mac-compactpro', 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), - 'bin' => 'application/macbinary', + 'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'), 'dms' => 'application/octet-stream', 'lha' => 'application/octet-stream', 'lzh' => 'application/octet-stream', @@ -39,6 +39,7 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'dvi' => 'application/x-dvi', 'gtar' => 'application/x-gtar', 'gz' => 'application/x-gzip', + 'gzip' => 'application/x-gzip', 'php' => 'application/x-httpd-php', 'php4' => 'application/x-httpd-php', 'php3' => 'application/x-httpd-php', @@ -51,14 +52,14 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'tgz' => array('application/x-tar', 'application/x-gzip-compressed'), 'xhtml' => 'application/xhtml+xml', 'xht' => 'application/xhtml+xml', - 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), + 'zip' => array('application/x-zip', 'application/zip', 'application/x-zip-compressed'), 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'mpga' => 'audio/mpeg', 'mp2' => 'audio/mpeg', 'mp3' => array('audio/mpeg', 'audio/mpg', 'audio/mpeg3', 'audio/mp3'), - 'aif' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', + 'aif' => array('audio/x-aiff', 'audio/aiff'), + 'aiff' => array('audio/x-aiff', 'audio/aiff'), 'aifc' => 'audio/x-aiff', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', @@ -66,7 +67,7 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'ra' => 'audio/x-realaudio', 'rv' => 'video/vnd.rn-realvideo', 'wav' => 'audio/x-wav', - 'bmp' => 'image/bmp', + 'bmp' => array('image/bmp', 'image/x-windows-bmp'), 'gif' => 'image/gif', 'jpeg' => array('image/jpeg', 'image/pjpeg'), 'jpg' => array('image/jpeg', 'image/pjpeg'), @@ -90,7 +91,7 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'mpe' => 'video/mpeg', 'qt' => 'video/quicktime', 'mov' => 'video/quicktime', - 'avi' => 'video/x-msvideo', + 'avi' => array('video/x-msvideo', 'video/msvideo', 'video/avi', 'application/x-troff-msvideo'), 'movie' => 'video/x-sgi-movie', 'doc' => 'application/msword', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', @@ -98,7 +99,40 @@ $mimes = array( 'hqx' => 'application/mac-binhex40', 'word' => array('application/msword', 'application/octet-stream'), 'xl' => 'application/excel', 'eml' => 'message/rfc822', - 'json' => array('application/json', 'text/json') + 'json' => array('application/json', 'text/json'), + 'pem' => array('application/x-x509-user-cert', 'application/x-pem-file', 'application/octet-stream'), + 'p10' => array('application/x-pkcs10', 'application/pkcs10'), + 'p12' => 'application/x-pkcs12', + 'p7a' => 'application/x-pkcs7-signature', + 'p7c' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'), + 'p7m' => array('application/pkcs7-mime', 'application/x-pkcs7-mime'), + 'p7r' => 'application/x-pkcs7-certreqresp', + 'p7s' => 'application/pkcs7-signature', + 'crt' => array('application/x-x509-ca-cert', 'application/x-x509-user-cert', 'application/pkix-cert'), + 'crl' => array('application/pkix-crl', 'application/pkcs-crl'), + 'der' => 'application/x-x509-ca-cert', + 'kdb' => 'application/octet-stream', + 'pgp' => 'application/pgp', + 'gpg' => 'application/gpg-keys', + 'sst' => 'application/octet-stream', + 'csr' => 'application/octet-stream', + 'rsa' => 'application/x-pkcs7', + 'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'), + '3g2' => 'video/3gpp2', + '3gp' => 'video/3gp', + 'mp4' => 'video/mp4', + 'm4a' => 'audio/x-m4a', + 'f4v' => 'video/mp4', + 'aac' => 'audio/x-acc', + 'm4u' => 'application/vnd.mpegurl', + 'm3u' => 'text/plain', + 'xspf' => 'application/xspf+xml', + 'vlc' => 'application/videolan', + 'wmv' => 'video/x-ms-wmv', + 'au' => 'audio/x-au', + 'ac3' => 'audio/ac3', + 'flac' => 'audio/x-flac', + 'ogg' => 'audio/ogg', ); diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 9d8fd2b54..2c6cb5ab5 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -125,6 +125,11 @@ Change Log
  • Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
  • Added "application/x-csv" to mimes.php.
  • Fixed a bug where Email library attachments with a "." in the name would using invalid MIME-types.
  • +
  • Added support for pem,p10,p12,p7a,p7c,p7m,p7r,p7s,crt,crl,der,kdb,rsa,cer,sst,csr Certs to mimes.php.
  • +
  • Added support pgp,gpg to mimes.php.
  • +
  • Added support 3gp, 3g2, mp4, wmv, f4v, vlc Video files to mimes.php.
  • +
  • Added support m4a, aac, m4u, xspf, au, ac3, flac, ogg Audio files to mimes.php.
  • +
  • Helpers -- cgit v1.2.3-24-g4f1b From aadf15d2b5337b7c66dc974d0b7a872030ed02c1 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Wed, 24 Aug 2011 03:55:41 -0300 Subject: Removed bracket from last link. --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 599fdb3cf..dfcf856f2 100644 --- a/readme.md +++ b/readme.md @@ -7,4 +7,4 @@ CodeIgniter is an Application Development Framework - a toolkit - for people who * [User Guide](http://codeigniter.com/user_guide/) * [Community Forums](http://codeigniter.com/forums/) * [Community Wiki](http://codeigniter.com/wiki/) - * [Community IRC](http://webchat.freenode.net/?channels=codeigniter&uio=d4)] \ No newline at end of file + * [Community IRC](http://webchat.freenode.net/?channels=codeigniter&uio=d4) \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 6a93995f2a24c0ac8d636ecac5f3eb0d0243e23d Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Wed, 24 Aug 2011 09:20:36 +0100 Subject: Added note in changelog --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index c52a33e5a..5e412ca44 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -75,6 +75,7 @@ Change Log
  • Visual updates to the welcome_message view file and default error templates. Thanks to danijelb for the pull request.
  • Added insert_batch() function to the PostgreSQL database driver. Thanks to epallerols for the patch.
  • Added "application/x-csv" to mimes.php.
  • +
  • Added CSRF protection URI whitelisting.
  • Fixed a bug where Email library attachments with a "." in the name would using invalid MIME-types.
  • -- cgit v1.2.3-24-g4f1b From 2653e05752d865b921fd4f92d2b9b3eafeae2ac0 Mon Sep 17 00:00:00 2001 From: purandi Date: Wed, 24 Aug 2011 18:31:39 +0700 Subject: Fix link database driver on changelog --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 4c207d6bc..d095c2f5f 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -77,7 +77,7 @@ Change Log
  • Database

    Version 2.0.3

    -- cgit v1.2.3-24-g4f1b From 84d76ea2559ddd72b5d1ddbe6fa38e88d9b20c16 Mon Sep 17 00:00:00 2001 From: Michiel Vugteveen Date: Thu, 25 Aug 2011 21:25:12 +0200 Subject: odbc called incorrect parent in construct --- system/database/drivers/odbc/odbc_driver.php | 2 +- user_guide/changelog.html | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/database/drivers/odbc/odbc_driver.php b/system/database/drivers/odbc/odbc_driver.php index 5e764e071..08cd27b6c 100644 --- a/system/database/drivers/odbc/odbc_driver.php +++ b/system/database/drivers/odbc/odbc_driver.php @@ -50,7 +50,7 @@ class CI_DB_odbc_driver extends CI_DB { function CI_DB_odbc_driver($params) { - parent::CI_DB($params); + parent::CI_DB_driver($params); $this->_random_keyword = ' RND('.time().')'; // database specific random keyword } diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 865bdd8ac..62f6b4f33 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -108,6 +108,7 @@ Change Log
  • Fixed a bug (#160) - Removed unneeded array copy in the file cache driver.
  • Fixed a bug (#150) - field_data() now correctly returns column length.
  • Fixed a bug (#8) - load_class() now looks for core classes in APPPATH first, allowing them to be replaced.
  • +
  • Fixed a bug (#24) - ODBC database driver called incorrect parent in __construct().
  • Version 2.0.3

    -- cgit v1.2.3-24-g4f1b From 6935931e0165aed0ef2d5bc9c0f51bf845969c35 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Thu, 25 Aug 2011 18:20:02 -0300 Subject: Fixed spelling mistake. --- user_guide/changelog.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index d7a6c7e05..865bdd8ac 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -67,7 +67,7 @@ Change Log
    • Callback validation rules can now accept parameters like any other validation rule.
    • Ability to log certain error types, not all under a threshold.
    • -
    • Added html_escape() to the Common functions to escape HTML output for preventing XSS easliy.
    • +
    • Added html_escape() to Common functions to escape HTML output for preventing XSS.
  • Helpers -- cgit v1.2.3-24-g4f1b From f7345e4f5f6e44886eac337d8da064f541df8b9a Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 27 Aug 2011 06:51:16 +1200 Subject: changed private functions to protected so MY_URI can override them. --- system/core/URI.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/core/URI.php b/system/core/URI.php index a3ae20cc3..8946bc76b 100755 --- a/system/core/URI.php +++ b/system/core/URI.php @@ -175,7 +175,7 @@ class CI_URI { * @access private * @return string */ - private function _detect_uri() + protected function _detect_uri() { if ( ! isset($_SERVER['REQUEST_URI']) OR ! isset($_SERVER['SCRIPT_NAME'])) { @@ -232,7 +232,7 @@ class CI_URI { * @access private * @return string */ - private function _parse_cli_args() + protected function _parse_cli_args() { $args = array_slice($_SERVER['argv'], 1); -- cgit v1.2.3-24-g4f1b From eb630f32810c5d3eaa5e5c4df7183034f181e07c Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 27 Aug 2011 10:22:41 +1200 Subject: added core heading and note about protected functions in URI --- user_guide/changelog.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 865bdd8ac..f82dac9fa 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -95,6 +95,12 @@ Change Log
  • CI_Loader::_ci_autoloader() is now a protected method.
  • +
  • Core +
      + +
    • Changed private functions in CI_URI to protected so MY_URI can override them.
    • +
    +
  • Bug fixes for 2.1.0

    -- cgit v1.2.3-24-g4f1b From 1c342ebc83b2d303ba68415ce2ec6b5b173a1b66 Mon Sep 17 00:00:00 2001 From: Paul Date: Sat, 27 Aug 2011 10:23:38 +1200 Subject: spacing removed --- user_guide/changelog.html | 1 - 1 file changed, 1 deletion(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index f82dac9fa..bb80ab8b8 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -97,7 +97,6 @@ Change Log
  • Core
      -
    • Changed private functions in CI_URI to protected so MY_URI can override them.
  • -- cgit v1.2.3-24-g4f1b From 901998a9a517d96faff5c24fb40f98961f83c3cd Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 26 Aug 2011 10:03:33 +0100 Subject: Removed some error suppression, which would hide a Notice if the path cannot be read. I discovered this by foolishly passing the file_path, not the full_path but took forever for me to realise this as the error returned (thanks to this error suppression) was "GD is not installed" instead of "File cannot be read". Seeing that notice would have made much more sense. --- system/libraries/Image_lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 8902f524d..a8a0387d8 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -1334,7 +1334,7 @@ class CI_Image_lib { return FALSE; } - $vals = @getimagesize($path); + $vals = getimagesize($path); $types = array(1 => 'gif', 2 => 'jpeg', 3 => 'png'); -- cgit v1.2.3-24-g4f1b From ddae533eee59e356ed6f40a4f4976162c592965e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 26 Aug 2011 10:12:10 +0100 Subject: Moved the "is_unique" change log to 2.1.0-dev where it should have been first time. Sorry about that one, had to manually separate 2.0.3 changes from 2.1.0 based mainly on memory. --- user_guide/changelog.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index ff04787cf..c030ce77c 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -94,11 +94,12 @@ Change Log
  • Driver children can be located in any package path.
  • Added max_filename_increment config setting for Upload library.
  • CI_Loader::_ci_autoloader() is now a protected method.
  • +
  • Added is_unique to the Form Validation library.
  • Core
      -
    • Changed private functions in CI_URI to protected so MY_URI can override them.
    • +
    • Changed private functions in CI_URI to protected so MY_URI can override them.
  • @@ -153,7 +154,6 @@ Change Log
  • Libraries
    • Altered Session to use a longer match against the user_agent string. See upgrade notes if using database sessions.
    • -
    • Added is_unique to the Form Validation library.
    • Added $this->db->set_dbprefix() to the Database Driver.
    • Changed $this->cart->insert() in the Cart Library to return the Row ID if a single item was inserted successfully.
    • Added $this->load->get_var() to the Loader library to retrieve global vars set with $this->load->view() and $this->load->vars().
    • -- cgit v1.2.3-24-g4f1b From 44cdece942c310f5520497dbde4febc26e96c27e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Fri, 26 Aug 2011 12:23:18 +0100 Subject: Bumped URL Helper version number. --- user_guide/helpers/url_helper.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/helpers/url_helper.html b/user_guide/helpers/url_helper.html index de28a6f56..e60e96bf0 100644 --- a/user_guide/helpers/url_helper.html +++ b/user_guide/helpers/url_helper.html @@ -27,7 +27,7 @@
      - +

      CodeIgniter User Guide Version 2.0.0

      CodeIgniter User Guide Version 2.0.3

      -- cgit v1.2.3-24-g4f1b From d8f002c6c92ed8395331b69ea77c4e5a83bfd83c Mon Sep 17 00:00:00 2001 From: Iban Eguia Date: Fri, 26 Aug 2011 14:34:38 +0200 Subject: Removed some documentation for PHP 4 users in the active record documentation. --- user_guide/database/active_record.html | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/user_guide/database/active_record.html b/user_guide/database/active_record.html index 92d9614d5..0f09e78c3 100644 --- a/user_guide/database/active_record.html +++ b/user_guide/database/active_record.html @@ -79,9 +79,6 @@ is generated by each database adapter. It also allows for safer queries, since

      The following functions allow you to build SQL SELECT statements.

      -

      Note: If you are using PHP 5 you can use method chaining for more compact syntax. This is described at the end of the page.

      - -

      $this->db->get();

      Runs the selection query and returns the result. Can be used by itself to retrieve all records from a table:

      @@ -532,7 +529,7 @@ $this->db->insert('mytable', $object);

      Generates an insert string based on the data you supply, and runs the query. You can either pass an array or an object to the function. Here is an example using an array:

      - + $data = array(
         array(
            'title' => 'My title' ,
      @@ -544,7 +541,7 @@ $data = array(
            'name' => 'Another Name' ,
            'date' => 'Another date'
         )
      -);
      +);

      $this->db->update_batch('mytable', $data);

      -- cgit v1.2.3-24-g4f1b From b183ece10dcde599c04af412f0f5c1c776ed29d8 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Fri, 26 Aug 2011 14:42:52 -0400 Subject: Changed CI_VERSION to represent develop branch --- system/core/CodeIgniter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 0a1391d18..aca4fb23c 100755 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -39,7 +39,7 @@ * @var string * */ - define('CI_VERSION', '2.0.2'); + define('CI_VERSION', '2.1.0-dev'); /** * CodeIgniter Branch (Core = TRUE, Reactor = FALSE) -- cgit v1.2.3-24-g4f1b From d720af7ce5539c0c5f1a604358a96bcf54af80fd Mon Sep 17 00:00:00 2001 From: Bruno Bierbaumer Date: Sat, 27 Aug 2011 16:13:14 +0200 Subject: add Android user agent --- application/config/user_agents.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/config/user_agents.php b/application/config/user_agents.php index e2d3c3af0..4746f2fcd 100644 --- a/application/config/user_agents.php +++ b/application/config/user_agents.php @@ -126,6 +126,7 @@ $mobiles = array( 'sendo' => "Sendo", // Operating Systems + 'android' => "Android", 'symbian' => "Symbian", 'SymbianOS' => "SymbianOS", 'elaine' => "Palm", -- cgit v1.2.3-24-g4f1b From 95b7994a298a7c57118c59e03a1aa43bd804bce4 Mon Sep 17 00:00:00 2001 From: Bruno Bierbaumer Date: Sat, 27 Aug 2011 16:52:24 +0200 Subject: add Android user agent --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index 33e0a62c1..978b710be 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,6 +65,7 @@ Change Log
      • General Changes
          +
        • Added Android to the list of user agents.
        • Callback validation rules can now accept parameters like any other validation rule.
        • Ability to log certain error types, not all under a threshold.
        • Added html_escape() to Common functions to escape HTML output for preventing XSS.
        • -- cgit v1.2.3-24-g4f1b From 8cc0cfe1ab1e10aad71d14e0b43e05444c00693d Mon Sep 17 00:00:00 2001 From: freewil Date: Sat, 27 Aug 2011 21:53:00 -0400 Subject: always use charset config item --- application/config/config.php | 2 ++ system/core/Security.php | 3 ++- system/helpers/form_helper.php | 7 ++----- system/helpers/typography_helper.php | 5 ++++- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 880393c29..a6d10d8dc 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -79,6 +79,8 @@ $config['language'] = 'english'; | This determines which character set is used by default in various methods | that require a character set to be provided. | +| See http://php.net/htmlspecialchars for a list of supported charsets. +| */ $config['charset'] = 'UTF-8'; diff --git a/system/core/Security.php b/system/core/Security.php index 342455f27..cc21ddc91 100755 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -525,9 +525,10 @@ class CI_Security { * @param string * @return string */ - public function entity_decode($str, $charset='UTF-8') + public function entity_decode($str, $charset = NULL) { if (stristr($str, '&') === FALSE) return $str; + if (empty($charset)) $charset = config_item('charset'); // The reason we are not using html_entity_decode() by itself is because // while it is not technically correct to leave out the semicolon diff --git a/system/helpers/form_helper.php b/system/helpers/form_helper.php index d9305c00b..130daee6a 100644 --- a/system/helpers/form_helper.php +++ b/system/helpers/form_helper.php @@ -642,11 +642,8 @@ if ( ! function_exists('form_prep')) { return $str; } - - $str = htmlspecialchars($str); - - // In case htmlspecialchars misses these. - $str = str_replace(array("'", '"'), array("'", """), $str); + + $str = html_escape($str); if ($field_name != '') { diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 19b4eec03..0bb0938a4 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -82,9 +82,12 @@ if ( ! function_exists('auto_typography')) */ if ( ! function_exists('entity_decode')) { - function entity_decode($str, $charset='UTF-8') + function entity_decode($str, $charset = NULL) { global $SEC; + + if (empty($charset)) $charset = config_item('charset'); + return $SEC->entity_decode($str, $charset); } } -- cgit v1.2.3-24-g4f1b From dae42fa65fc65e43d704f1a6c139e985e93486f4 Mon Sep 17 00:00:00 2001 From: bubbafoley Date: Sun, 28 Aug 2011 00:54:24 -0500 Subject: Fix the default migration path. --- system/libraries/Migration.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 3943ec130..3734e18f5 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -57,7 +57,7 @@ class CI_Migration { } // If not set, set it - $this->_migration_path == '' OR $this->_migration_path = APPPATH . 'migrations/'; + $this->_migration_path == '' AND $this->_migration_path = APPPATH . 'migrations/'; // Add trailing slash if not set $this->_migration_path = rtrim($this->_migration_path, '/').'/'; -- cgit v1.2.3-24-g4f1b From 4c907236af3b6dc11a7b4989ece1c84a26483c46 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Sun, 28 Aug 2011 17:11:03 +0100 Subject: Fixed recent change to $this->db->field_data() which errored for field types without constraints. It now uses a less expecting regex and defaults to NULL. --- system/database/drivers/mysql/mysql_result.php | 4 ++-- system/database/drivers/mysqli/mysqli_result.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php index 2d2905c98..6ceaf4b9b 100644 --- a/system/database/drivers/mysql/mysql_result.php +++ b/system/database/drivers/mysql/mysql_result.php @@ -86,10 +86,10 @@ class CI_DB_mysql_result extends CI_DB_result { $retval = array(); while ($field = mysql_fetch_object($this->result_id)) { - preg_match('/([a-zA-Z]+)\((\d+)\)/', $field->Type, $matches); + preg_match('/([a-zA-Z]+)(\((\d+)\))?/i', $field->Type, $matches); $type = $matches[1]; - $length = (int)$matches[2]; + $length = isset($matches[3]) ? (int) $matches[3] : NULL; $F = new stdClass(); $F->name = $field->Field; diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php index ac863056a..bbfb8481a 100644 --- a/system/database/drivers/mysqli/mysqli_result.php +++ b/system/database/drivers/mysqli/mysqli_result.php @@ -86,10 +86,10 @@ class CI_DB_mysqli_result extends CI_DB_result { $retval = array(); while ($field = mysqli_fetch_object($this->result_id)) { - preg_match('/([a-zA-Z]+)\((\d+)\)/', $field->Type, $matches); + preg_match('/([a-zA-Z]+)(\((\d+)\))?/i', $field->Type, $matches); $type = $matches[1]; - $length = (int)$matches[2]; + $length = isset($matches[3]) ? (int) $matches[3] : NULL; $F = new stdClass(); $F->name = $field->Field; -- cgit v1.2.3-24-g4f1b From 5c9b0d1b5618ade5c6aa70475b08b3066f14ff3e Mon Sep 17 00:00:00 2001 From: freewil Date: Sun, 28 Aug 2011 12:15:23 -0400 Subject: always use charset config item --- system/core/Security.php | 11 +++++++++-- system/helpers/typography_helper.php | 7 ++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/system/core/Security.php b/system/core/Security.php index cc21ddc91..e99418bdd 100755 --- a/system/core/Security.php +++ b/system/core/Security.php @@ -527,8 +527,15 @@ class CI_Security { */ public function entity_decode($str, $charset = NULL) { - if (stristr($str, '&') === FALSE) return $str; - if (empty($charset)) $charset = config_item('charset'); + if (stristr($str, '&') === FALSE) + { + return $str; + } + + if (empty($charset)) + { + $charset = config_item('charset'); + } // The reason we are not using html_entity_decode() by itself is because // while it is not technically correct to leave out the semicolon diff --git a/system/helpers/typography_helper.php b/system/helpers/typography_helper.php index 0bb0938a4..82e686e53 100644 --- a/system/helpers/typography_helper.php +++ b/system/helpers/typography_helper.php @@ -39,9 +39,7 @@ if ( ! function_exists('nl2br_except_pre')) function nl2br_except_pre($str) { $CI =& get_instance(); - $CI->load->library('typography'); - return $CI->typography->nl2br_except_pre($str); } } @@ -86,7 +84,10 @@ if ( ! function_exists('entity_decode')) { global $SEC; - if (empty($charset)) $charset = config_item('charset'); + if (empty($charset)) + { + $charset = config_item('charset'); + } return $SEC->entity_decode($str, $charset); } -- cgit v1.2.3-24-g4f1b From f916839be7997973d8dd40619e1f8aa7518c96a7 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 29 Aug 2011 19:29:05 -0500 Subject: CI Coding standards cleanup in the date helper. --- system/helpers/date_helper.php | 65 ++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index 6c559bb25..e8a530353 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -85,12 +85,20 @@ if ( ! function_exists('mdate')) function mdate($datestr = '', $time = '') { if ($datestr == '') - return ''; + { + return ''; + } if ($time == '') - $time = now(); + { + $time = now(); + } - $datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr)); + $datestr = str_replace( + '%\\', + '', + preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr) + ); return date($datestr, $time); } } @@ -162,14 +170,7 @@ if ( ! function_exists('timespan')) $time = time(); } - if ($time <= $seconds) - { - $seconds = 1; - } - else - { - $seconds = $time - $seconds; - } + $seconds = ($time <= $seconds) ? 1 : $time - $seconds; $str = ''; $years = floor($seconds / 31536000); @@ -303,9 +304,18 @@ if ( ! function_exists('local_to_gmt')) function local_to_gmt($time = '') { if ($time == '') + { $time = time(); - - return mktime( gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time)); + } + + return mktime( + gmdate("H", $time), + gmdate("i", $time), + gmdate("s", $time), + gmdate("m", $time), + gmdate("d", $time), + gmdate("Y", $time) + ); } } @@ -475,13 +485,19 @@ if ( ! function_exists('human_to_unix')) $ampm = strtolower($split['2']); if (substr($ampm, 0, 1) == 'p' AND $hour < 12) - $hour = $hour + 12; + { + $hour = $hour + 12; + } if (substr($ampm, 0, 1) == 'a' AND $hour == 12) + { $hour = '00'; - + } + if (strlen($hour) == 1) - $hour = '0'.$hour; + { + $hour = '0'.$hour; + } } return mktime($hour, $min, $sec, $month, $day, $year); @@ -501,16 +517,16 @@ if ( ! function_exists('human_to_unix')) */ if ( ! function_exists('nice_date')) { - function nice_date($bad_date='', $format=false) + function nice_date($bad_date = '', $format = FALSE) { if (empty($bad_date)) { return 'Unknown'; } + // Date like: YYYYMM - if (preg_match('/^\d{6}$/',$bad_date)) + if (preg_match('/^\d{6}$/', $bad_date)) { - //echo $bad_date." "; if (in_array(substr($bad_date, 0, 2),array('19', '20'))) { $year = substr($bad_date, 0, 4); @@ -521,8 +537,8 @@ if ( ! function_exists('nice_date')) $month = substr($bad_date, 0, 2); $year = substr($bad_date, 2, 4); } + return date($format, strtotime($year . '-' . $month . '-01')); - } // Date Like: YYYYMMDD @@ -531,6 +547,7 @@ if ( ! function_exists('nice_date')) $month = substr($bad_date, 0, 2); $day = substr($bad_date, 2, 2); $year = substr($bad_date, 4, 4); + return date($format, strtotime($month . '/01/' . $year)); } @@ -664,14 +681,12 @@ if ( ! function_exists('timezones')) { return $zones; } - - if ($tz == 'GMT') - $tz = 'UTC'; - + + $tz = ($tz == 'GMT') ? 'UTC' : $tz; + return ( ! isset($zones[$tz])) ? 0 : $zones[$tz]; } } - /* End of file date_helper.php */ /* Location: ./system/helpers/date_helper.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From c964e72aabc3a646dbb82f6bf609e9532e75d011 Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Mon, 29 Aug 2011 19:31:29 -0500 Subject: A bit more cleanup in the date helper. --- system/helpers/date_helper.php | 113 ++++++++++++++++++++--------------------- 1 file changed, 54 insertions(+), 59 deletions(-) diff --git a/system/helpers/date_helper.php b/system/helpers/date_helper.php index e8a530353..e14bc2f94 100644 --- a/system/helpers/date_helper.php +++ b/system/helpers/date_helper.php @@ -54,10 +54,8 @@ if ( ! function_exists('now')) return $system_time; } - else - { - return time(); - } + + return time(); } } @@ -89,16 +87,14 @@ if ( ! function_exists('mdate')) return ''; } - if ($time == '') - { - $time = now(); - } + $time = ($time == '') ? now() : $time; $datestr = str_replace( '%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr) ); + return date($datestr, $time); } } @@ -376,14 +372,14 @@ if ( ! function_exists('mysql_to_unix')) $time = str_replace(' ', '', $time); // YYYYMMDDHHMMSS - return mktime( - substr($time, 8, 2), - substr($time, 10, 2), - substr($time, 12, 2), - substr($time, 4, 2), - substr($time, 6, 2), - substr($time, 0, 4) - ); + return mktime( + substr($time, 8, 2), + substr($time, 10, 2), + substr($time, 12, 2), + substr($time, 4, 2), + substr($time, 6, 2), + substr($time, 0, 4) + ); } } @@ -591,8 +587,7 @@ if ( ! function_exists('timezone_menu')) $CI =& get_instance(); $CI->lang->load('date'); - if ($default == 'GMT') - $default = 'UTC'; + $default = ($default == 'GMT') ? 'UTC' : $default; $menu = 'Search User Guide    + + + + +
          + + + +
          + +

          Upgrading from 2.0.3 to 2.1.0

          + +

          Before performing an update you should take your site offline by replacing the index.php file with a static one.

          + +

          Step 1: Update your CodeIgniter files

          + +

          Replace all files and directories in your "system" folder and replace your index.php file. If any modifications were made to your index.php they will need to be made fresh in this new one.

          + +

          Note: If you have any custom developed files in these folders please make copies of them first.

          + + + + +
          + + + + + + + \ No newline at end of file -- cgit v1.2.3-24-g4f1b From d369077ac6cae25fa51c9840a466e54333300d0a Mon Sep 17 00:00:00 2001 From: Greg Aker Date: Wed, 31 Aug 2011 01:39:43 -0500 Subject: Removing class="reactor" from changelog items for 2.1.0 release. There is only one CI now, so this is no longer needed. --- user_guide/changelog.html | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index b3a58617e..e2ef2f455 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -65,42 +65,42 @@ Change Log
          • General Changes
              -
            • Added Android to the list of user agents.
            • -
            • Callback validation rules can now accept parameters like any other validation rule.
            • -
            • Ability to log certain error types, not all under a threshold.
            • -
            • Added html_escape() to Common functions to escape HTML output for preventing XSS.
            • +
            • Added Android to the list of user agents.
            • +
            • Callback validation rules can now accept parameters like any other validation rule.
            • +
            • Ability to log certain error types, not all under a threshold.
            • +
            • Added html_escape() to Common functions to escape HTML output for preventing XSS.
          • Helpers
              -
            • Added increment_string() to String Helper to turn "foo" into "foo-1" or "foo-1" into "foo-2".
            • +
            • Added increment_string() to String Helper to turn "foo" into "foo-1" or "foo-1" into "foo-2".
            • Altered form helper - made action on form_open_multipart helper function call optional. Fixes (#65)
            • url_title() will now trim extra dashes from beginning and end.
          • Database
              -
            • Added a CUBRID driver to the Database Driver. Thanks to the CUBRID team for supplying this patch.
            • -
            • Typecast limit and offset in the Database Driver to integers to avoid possible injection.
            • -
            • +
            • Added a CUBRID driver to the Database Driver. Thanks to the CUBRID team for supplying this patch.
            • +
            • Typecast limit and offset in the Database Driver to integers to avoid possible injection.
            • +
            • Added additional option 'none' for the optional third argument for $this->db->like() in the Database Driver.
          • Libraries
              -
            • Changed $this->cart->insert() in the Cart Library to return the Row ID if a single item was inserted successfully.
            • -
            • Added support to set an optional parameter in your callback rules of validation using the Form Validation Library.
            • -
            • Added a Migration Library to assist with applying incremental updates to your database schema.
            • -
            • Driver children can be located in any package path.
            • -
            • Added max_filename_increment config setting for Upload library.
            • +
            • Changed $this->cart->insert() in the Cart Library to return the Row ID if a single item was inserted successfully.
            • +
            • Added support to set an optional parameter in your callback rules of validation using the Form Validation Library.
            • +
            • Added a Migration Library to assist with applying incremental updates to your database schema.
            • +
            • Driver children can be located in any package path.
            • +
            • Added max_filename_increment config setting for Upload library.
            • CI_Loader::_ci_autoloader() is now a protected method.
            • -
            • Added is_unique to the Form Validation library.
            • +
            • Added is_unique to the Form Validation library.
          • Core
              -
            • Changed private functions in CI_URI to protected so MY_URI can override them.
            • +
            • Changed private functions in CI_URI to protected so MY_URI can override them.
          -- cgit v1.2.3-24-g4f1b From 995af497e636297ce1584c350e97ce67605a2c6d Mon Sep 17 00:00:00 2001 From: mmestrovic Date: Wed, 31 Aug 2011 17:25:27 +0300 Subject: added Windows 7 platform renamed Windows Longhorn to Windows Vista fixed tabs changed order of nt5.1 and nt5.0 platforms --- application/config/user_agents.php | 249 +++++++++++++++++++------------------ 1 file changed, 125 insertions(+), 124 deletions(-) diff --git a/application/config/user_agents.php b/application/config/user_agents.php index 4746f2fcd..9080b43f6 100644 --- a/application/config/user_agents.php +++ b/application/config/user_agents.php @@ -11,168 +11,169 @@ */ $platforms = array ( - 'windows nt 6.0' => 'Windows Longhorn', + 'windows nt 6.1' => 'Windows 7', + 'windows nt 6.0' => 'Windows Vista', 'windows nt 5.2' => 'Windows 2003', - 'windows nt 5.0' => 'Windows 2000', 'windows nt 5.1' => 'Windows XP', + 'windows nt 5.0' => 'Windows 2000', 'windows nt 4.0' => 'Windows NT 4.0', - 'winnt4.0' => 'Windows NT 4.0', - 'winnt 4.0' => 'Windows NT', - 'winnt' => 'Windows NT', + 'winnt4.0' => 'Windows NT 4.0', + 'winnt 4.0' => 'Windows NT', + 'winnt' => 'Windows NT', 'windows 98' => 'Windows 98', - 'win98' => 'Windows 98', + 'win98' => 'Windows 98', 'windows 95' => 'Windows 95', - 'win95' => 'Windows 95', - 'windows' => 'Unknown Windows OS', - 'os x' => 'Mac OS X', - 'ppc mac' => 'Power PC Mac', - 'freebsd' => 'FreeBSD', - 'ppc' => 'Macintosh', - 'linux' => 'Linux', - 'debian' => 'Debian', - 'sunos' => 'Sun Solaris', - 'beos' => 'BeOS', + 'win95' => 'Windows 95', + 'windows' => 'Unknown Windows OS', + 'os x' => 'Mac OS X', + 'ppc mac' => 'Power PC Mac', + 'freebsd' => 'FreeBSD', + 'ppc' => 'Macintosh', + 'linux' => 'Linux', + 'debian' => 'Debian', + 'sunos' => 'Sun Solaris', + 'beos' => 'BeOS', 'apachebench' => 'ApacheBench', - 'aix' => 'AIX', - 'irix' => 'Irix', - 'osf' => 'DEC OSF', - 'hp-ux' => 'HP-UX', - 'netbsd' => 'NetBSD', - 'bsdi' => 'BSDi', - 'openbsd' => 'OpenBSD', - 'gnu' => 'GNU/Linux', - 'unix' => 'Unknown Unix OS' + 'aix' => 'AIX', + 'irix' => 'Irix', + 'osf' => 'DEC OSF', + 'hp-ux' => 'HP-UX', + 'netbsd' => 'NetBSD', + 'bsdi' => 'BSDi', + 'openbsd' => 'OpenBSD', + 'gnu' => 'GNU/Linux', + 'unix' => 'Unknown Unix OS' ); // The order of this array should NOT be changed. Many browsers return // multiple browser types so we want to identify the sub-type first. $browsers = array( - 'Flock' => 'Flock', - 'Chrome' => 'Chrome', - 'Opera' => 'Opera', - 'MSIE' => 'Internet Explorer', + 'Flock' => 'Flock', + 'Chrome' => 'Chrome', + 'Opera' => 'Opera', + 'MSIE' => 'Internet Explorer', 'Internet Explorer' => 'Internet Explorer', - 'Shiira' => 'Shiira', - 'Firefox' => 'Firefox', - 'Chimera' => 'Chimera', - 'Phoenix' => 'Phoenix', - 'Firebird' => 'Firebird', - 'Camino' => 'Camino', - 'Netscape' => 'Netscape', - 'OmniWeb' => 'OmniWeb', - 'Safari' => 'Safari', - 'Mozilla' => 'Mozilla', - 'Konqueror' => 'Konqueror', - 'icab' => 'iCab', - 'Lynx' => 'Lynx', - 'Links' => 'Links', - 'hotjava' => 'HotJava', - 'amaya' => 'Amaya', - 'IBrowse' => 'IBrowse' + 'Shiira' => 'Shiira', + 'Firefox' => 'Firefox', + 'Chimera' => 'Chimera', + 'Phoenix' => 'Phoenix', + 'Firebird' => 'Firebird', + 'Camino' => 'Camino', + 'Netscape' => 'Netscape', + 'OmniWeb' => 'OmniWeb', + 'Safari' => 'Safari', + 'Mozilla' => 'Mozilla', + 'Konqueror' => 'Konqueror', + 'icab' => 'iCab', + 'Lynx' => 'Lynx', + 'Links' => 'Links', + 'hotjava' => 'HotJava', + 'amaya' => 'Amaya', + 'IBrowse' => 'IBrowse' ); $mobiles = array( // legacy array, old values commented out 'mobileexplorer' => 'Mobile Explorer', -// 'openwave' => 'Open Wave', +// 'openwave' => 'Open Wave', // 'opera mini' => 'Opera Mini', -// 'operamini' => 'Opera Mini', -// 'elaine' => 'Palm', +// 'operamini' => 'Opera Mini', +// 'elaine' => 'Palm', 'palmsource' => 'Palm', // 'digital paths' => 'Palm', -// 'avantgo' => 'Avantgo', -// 'xiino' => 'Xiino', - 'palmscape' => 'Palmscape', -// 'nokia' => 'Nokia', -// 'ericsson' => 'Ericsson', +// 'avantgo' => 'Avantgo', +// 'xiino' => 'Xiino', + 'palmscape' => 'Palmscape', +// 'nokia' => 'Nokia', +// 'ericsson' => 'Ericsson', // 'blackberry' => 'BlackBerry', -// 'motorola' => 'Motorola' +// 'motorola' => 'Motorola' // Phones and Manufacturers - 'motorola' => "Motorola", - 'nokia' => "Nokia", - 'palm' => "Palm", - 'iphone' => "Apple iPhone", - 'ipad' => "iPad", - 'ipod' => "Apple iPod Touch", - 'sony' => "Sony Ericsson", - 'ericsson' => "Sony Ericsson", + 'motorola' => "Motorola", + 'nokia' => "Nokia", + 'palm' => "Palm", + 'iphone' => "Apple iPhone", + 'ipad' => "iPad", + 'ipod' => "Apple iPod Touch", + 'sony' => "Sony Ericsson", + 'ericsson' => "Sony Ericsson", 'blackberry' => "BlackBerry", - 'cocoon' => "O2 Cocoon", - 'blazer' => "Treo", - 'lg' => "LG", - 'amoi' => "Amoi", - 'xda' => "XDA", - 'mda' => "MDA", - 'vario' => "Vario", - 'htc' => "HTC", - 'samsung' => "Samsung", - 'sharp' => "Sharp", - 'sie-' => "Siemens", - 'alcatel' => "Alcatel", - 'benq' => "BenQ", - 'ipaq' => "HP iPaq", - 'mot-' => "Motorola", + 'cocoon' => "O2 Cocoon", + 'blazer' => "Treo", + 'lg' => "LG", + 'amoi' => "Amoi", + 'xda' => "XDA", + 'mda' => "MDA", + 'vario' => "Vario", + 'htc' => "HTC", + 'samsung' => "Samsung", + 'sharp' => "Sharp", + 'sie-' => "Siemens", + 'alcatel' => "Alcatel", + 'benq' => "BenQ", + 'ipaq' => "HP iPaq", + 'mot-' => "Motorola", 'playstation portable' => "PlayStation Portable", - 'hiptop' => "Danger Hiptop", - 'nec-' => "NEC", - 'panasonic' => "Panasonic", - 'philips' => "Philips", - 'sagem' => "Sagem", - 'sanyo' => "Sanyo", - 'spv' => "SPV", - 'zte' => "ZTE", - 'sendo' => "Sendo", + 'hiptop' => "Danger Hiptop", + 'nec-' => "NEC", + 'panasonic' => "Panasonic", + 'philips' => "Philips", + 'sagem' => "Sagem", + 'sanyo' => "Sanyo", + 'spv' => "SPV", + 'zte' => "ZTE", + 'sendo' => "Sendo", - // Operating Systems - 'android' => "Android", - 'symbian' => "Symbian", - 'SymbianOS' => "SymbianOS", - 'elaine' => "Palm", - 'palm' => "Palm", - 'series60' => "Symbian S60", - 'windows ce' => "Windows CE", +// Operating Systems + 'android' => "Android", + 'symbian' => "Symbian", + 'SymbianOS' => "SymbianOS", + 'elaine' => "Palm", + 'palm' => "Palm", + 'series60' => "Symbian S60", + 'windows ce' => "Windows CE", // Browsers - 'obigo' => "Obigo", - 'netfront' => "Netfront Browser", - 'openwave' => "Openwave Browser", - 'mobilexplorer' => "Mobile Explorer", - 'operamini' => "Opera Mini", - 'opera mini' => "Opera Mini", + 'obigo' => "Obigo", + 'netfront' => "Netfront Browser", + 'openwave' => "Openwave Browser", + 'mobilexplorer' => "Mobile Explorer", + 'operamini' => "Opera Mini", + 'opera mini' => "Opera Mini", // Other - 'digital paths' => "Digital Paths", - 'avantgo' => "AvantGo", - 'xiino' => "Xiino", - 'novarra' => "Novarra Transcoder", - 'vodafone' => "Vodafone", - 'docomo' => "NTT DoCoMo", - 'o2' => "O2", + 'digital paths' => "Digital Paths", + 'avantgo' => "AvantGo", + 'xiino' => "Xiino", + 'novarra' => "Novarra Transcoder", + 'vodafone' => "Vodafone", + 'docomo' => "NTT DoCoMo", + 'o2' => "O2", // Fallback - 'mobile' => "Generic Mobile", - 'wireless' => "Generic Mobile", - 'j2me' => "Generic Mobile", - 'midp' => "Generic Mobile", - 'cldc' => "Generic Mobile", - 'up.link' => "Generic Mobile", - 'up.browser' => "Generic Mobile", - 'smartphone' => "Generic Mobile", - 'cellphone' => "Generic Mobile" + 'mobile' => "Generic Mobile", + 'wireless' => "Generic Mobile", + 'j2me' => "Generic Mobile", + 'midp' => "Generic Mobile", + 'cldc' => "Generic Mobile", + 'up.link' => "Generic Mobile", + 'up.browser' => "Generic Mobile", + 'smartphone' => "Generic Mobile", + 'cellphone' => "Generic Mobile" ); // There are hundreds of bots but these are the most common. $robots = array( - 'googlebot' => 'Googlebot', - 'msnbot' => 'MSNBot', - 'slurp' => 'Inktomi Slurp', - 'yahoo' => 'Yahoo', - 'askjeeves' => 'AskJeeves', + 'googlebot' => 'Googlebot', + 'msnbot' => 'MSNBot', + 'slurp' => 'Inktomi Slurp', + 'yahoo' => 'Yahoo', + 'askjeeves' => 'AskJeeves', 'fastcrawler' => 'FastCrawler', - 'infoseek' => 'InfoSeek Robot 1.0', - 'lycos' => 'Lycos' + 'infoseek' => 'InfoSeek Robot 1.0', + 'lycos' => 'Lycos' ); /* End of file user_agents.php */ -- cgit v1.2.3-24-g4f1b From 2c63be25edf0f55de4f0625709cd00752ea70f5a Mon Sep 17 00:00:00 2001 From: mmestrovic Date: Wed, 31 Aug 2011 17:52:38 +0300 Subject: General changes: Added Windows 7 to the list of user platforms. --- user_guide/changelog.html | 1 + 1 file changed, 1 insertion(+) diff --git a/user_guide/changelog.html b/user_guide/changelog.html index e2ef2f455..fb6e4493a 100644 --- a/user_guide/changelog.html +++ b/user_guide/changelog.html @@ -66,6 +66,7 @@ Change Log
        • General Changes
          • Added Android to the list of user agents.
          • +
          • Added Windows 7 to the list of user platforms.
          • Callback validation rules can now accept parameters like any other validation rule.
          • Ability to log certain error types, not all under a threshold.
          • Added html_escape() to Common functions to escape HTML output for preventing XSS.
          • -- cgit v1.2.3-24-g4f1b From 89878f3c007be72b59ceb53b201f32454231d1e6 Mon Sep 17 00:00:00 2001 From: mmestrovic Date: Wed, 31 Aug 2011 18:15:15 +0300 Subject: Added step 2: Replace config/user_agents.php --- user_guide/installation/upgrade_210.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/user_guide/installation/upgrade_210.html b/user_guide/installation/upgrade_210.html index 9f8204a7c..6e8ddec9d 100644 --- a/user_guide/installation/upgrade_210.html +++ b/user_guide/installation/upgrade_210.html @@ -63,6 +63,10 @@ Upgrading from 2.0.3 to 2.1.0

            Replace all files and directories in your "system" folder and replace your index.php file. If any modifications were made to your index.php they will need to be made fresh in this new one.

            +

            Step 2: Replace config/user_agents.php

            + +

            This config file has been updated to contain more user agent types, please copy it to application/config/user_agents.php.

            +

            Note: If you have any custom developed files in these folders please make copies of them first.

            -- cgit v1.2.3-24-g4f1b From 9d9ab3ad2cba4d369cd5a10b5fe675b31cc66480 Mon Sep 17 00:00:00 2001 From: Stolz Date: Wed, 31 Aug 2011 19:22:36 +0200 Subject: Added missing profiler section (session_data) --- user_guide/general/profiling.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/user_guide/general/profiling.html b/user_guide/general/profiling.html index 9895b0284..0993da5b4 100644 --- a/user_guide/general/profiling.html +++ b/user_guide/general/profiling.html @@ -154,6 +154,11 @@ This information can be useful during development in order to help with debuggin The URI of the current request TRUE + + session_data + Data stored in current session + TRUE + query_toggle_count The number of queries after which the query block will default to hidden. -- cgit v1.2.3-24-g4f1b From cb212c6ad80e85b8d41fea6a5bde26e4272dd223 Mon Sep 17 00:00:00 2001 From: MarcosCoelho Date: Wed, 31 Aug 2011 14:59:19 -0300 Subject: fixes some typo --- application/config/mimes.php | 2 +- application/config/routes.php | 2 +- application/config/smileys.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/application/config/mimes.php b/application/config/mimes.php index 90a1d18bb..206329fde 100644 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -8,7 +8,7 @@ | */ -$mimes = array('hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'), +$mimes = array('hqx' => array('application/mac-binhex40', 'application/mac-binhex', 'application/x-binhex40', 'application/x-mac-binhex40'), 'cpt' => 'application/mac-compactpro', 'csv' => array('text/x-comma-separated-values', 'text/comma-separated-values', 'application/octet-stream', 'application/vnd.ms-excel', 'application/x-csv', 'text/x-csv', 'text/csv', 'application/csv', 'application/excel', 'application/vnd.msexcel'), 'bin' => array('application/macbinary', 'application/mac-binary', 'application/octet-stream', 'application/x-binary', 'application/x-macbinary'), diff --git a/application/config/routes.php b/application/config/routes.php index 5f9a58343..f30a0d1f2 100644 --- a/application/config/routes.php +++ b/application/config/routes.php @@ -23,7 +23,7 @@ | RESERVED ROUTES | ------------------------------------------------------------------------- | -| There area two reserved routes: +| There are two reserved routes: | | $route['default_controller'] = 'welcome'; | diff --git a/application/config/smileys.php b/application/config/smileys.php index 25d28b2c4..38f02a9e0 100644 --- a/application/config/smileys.php +++ b/application/config/smileys.php @@ -60,7 +60,7 @@ $smileys = array( ':exclaim:' => array('exclaim.gif', '19', '19', 'excaim'), ':question:' => array('question.gif', '19', '19', 'question') // no comma after last item - ); +); /* End of file smileys.php */ /* Location: ./application/config/smileys.php */ \ No newline at end of file -- cgit v1.2.3-24-g4f1b From c93ec88bedc8103095bcdd8f0e2ea2308ee0aa3f Mon Sep 17 00:00:00 2001 From: mmestrovic Date: Thu, 1 Sep 2011 03:24:08 +0300 Subject: Added reference for CUBRID database as supported in CI. --- user_guide/general/requirements.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/requirements.html b/user_guide/general/requirements.html index 405798f04..de0ee76dd 100644 --- a/user_guide/general/requirements.html +++ b/user_guide/general/requirements.html @@ -59,7 +59,7 @@ Server Requirements
            • PHP version 5.1.6 or newer.
            • -
            • A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, SQLite, and ODBC.
            • +
            • A Database is required for most web application programming. Current supported databases are MySQL (4.1+), MySQLi, MS SQL, Postgres, Oracle, SQLite, ODBC and CUBRID.
            -- cgit v1.2.3-24-g4f1b From bf54e300e19c8e207ac2cb92e33b1c7f7debb66b Mon Sep 17 00:00:00 2001 From: mmestrovic Date: Thu, 1 Sep 2011 03:30:43 +0300 Subject: Updated download links for current and older versions. --- user_guide/installation/downloads.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/user_guide/installation/downloads.html b/user_guide/installation/downloads.html index f36b2bc0f..539fbc170 100644 --- a/user_guide/installation/downloads.html +++ b/user_guide/installation/downloads.html @@ -58,7 +58,9 @@ Downloading CodeIgniter

            Downloading CodeIgniter

              -
            • CodeIgniter V 2.0.2 (Current version)
            • +
            • CodeIgniter V 2.1.0 (Current version)
            • +
            • CodeIgniter V 2.0.3
            • +
            • CodeIgniter V 2.0.2
            • CodeIgniter V 2.0.1
            • CodeIgniter V 2.0.0
            • CodeIgniter V 1.7.3
            • -- cgit v1.2.3-24-g4f1b From 886d87c616bd422585c6a1190b0e1b72bc661269 Mon Sep 17 00:00:00 2001 From: Eric Barnes Date: Wed, 31 Aug 2011 22:56:21 -0400 Subject: Changed the irc link to point to CodeIgniter website --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index be807dbea..7919465d6 100644 --- a/readme.md +++ b/readme.md @@ -8,4 +8,4 @@ CodeIgniter is an Application Development Framework - a toolkit - for people who * [Community Forums](http://codeigniter.com/forums/) * [User Voice](http://codeigniter.uservoice.com/forums/40508-codeigniter-reactor) * [Community Wiki](http://codeigniter.com/wiki/) - * [Community IRC](http://webchat.freenode.net/?channels=codeigniter&uio=d4) \ No newline at end of file + * [Community IRC](http://codeigniter.com/irc/) \ No newline at end of file -- cgit v1.2.3-24-g4f1b From 0e857631f5c6f38c5715450ea3f6ff514ac65b2c Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 2 Sep 2011 08:41:17 +0900 Subject: fixes potential SQL injection vector in Active Record offset() --- system/database/DB_active_rec.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/database/DB_active_rec.php b/system/database/DB_active_rec.php index 37d162bc1..89766e304 100644 --- a/system/database/DB_active_rec.php +++ b/system/database/DB_active_rec.php @@ -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; } -- cgit v1.2.3-24-g4f1b From 87db1b7056ae2b964f13a8e3cc915b1bce8959d5 Mon Sep 17 00:00:00 2001 From: Thomas Traub Date: Sat, 3 Sep 2011 17:19:06 +0200 Subject: Changed up to down for down method error line --- system/language/english/migration_lang.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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."; -- cgit v1.2.3-24-g4f1b From e3f33942387909350d15adb1fa87d926fd5d8d03 Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Sun, 4 Sep 2011 13:55:28 +0100 Subject: Removed reference is IS_CLI in the documentation, which should have been $this->input->is_cli_request() --- user_guide/general/cli.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide/general/cli.html b/user_guide/general/cli.html index befc9994a..222a77c9d 100644 --- a/user_guide/general/cli.html +++ b/user_guide/general/cli.html @@ -83,7 +83,7 @@ Running via the CLI
              • Run your cron-jobs without needing to use wget or curl
              • -
              • Make your cron-jobs inaccessible from being loaded in the URL by checking for IS_CLI
              • +
              • Make your cron-jobs inaccessible from being loaded in the URL by checking for $this->input->is_cli_request()
              • Make interactive "tasks" that can do things like set permissions, prune cache folders, run backups, etc.
              • Integrate with other applications in other languages. For example, a random C++ script could call one command and run code in your models!
              -- cgit v1.2.3-24-g4f1b From 40d1a7684444f6a8eb4cda23d8822f0b258f0c3e Mon Sep 17 00:00:00 2001 From: Phil Sturgeon Date: Sun, 4 Sep 2011 13:57:52 +0100 Subject: Fixed incorrectly named variables in the documentation. --- user_guide/database/results.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide/database/results.html b/user_guide/database/results.html index ec5f97762..a47e335cb 100644 --- a/user_guide/database/results.html +++ b/user_guide/database/results.html @@ -105,8 +105,8 @@ Query Results
              foreach ($query->result('User') as $user)
              {
              -    echo $row->name; // call attributes
              -    echo $row->reverse_name(); // or methods defined on the 'User' class
              +    echo $user->name; // call attributes
              +    echo $user->reverse_name(); // or methods defined on the 'User' class
              }
              -- cgit v1.2.3-24-g4f1b