diff options
author | Ahmad Anbar <aanbar@gmail.com> | 2015-05-17 12:20:34 +0200 |
---|---|---|
committer | Ahmad Anbar <aanbar@gmail.com> | 2015-05-17 12:20:34 +0200 |
commit | 57940dedcaab05f2dc392b2757cb3d58c59274c9 (patch) | |
tree | 1783dc5a17cc20ddede409e13984576bff274302 | |
parent | 5e50c42ef27261bc7fcb279499ce76cfc2519aa6 (diff) | |
parent | 3a9eb39f61b10b3f86e50f4cd39ca0d9f010bac2 (diff) |
Merge remote-tracking branch 'upstream/develop' into develop
42 files changed, 207 insertions, 111 deletions
diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..51fea4174 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,22 @@ +# This file tells which files and directories should be ignored and +# NOT downloaded when using composer to pull down a project with +# the --prefer-dist option selected. Used to remove development +# specific files so user has a clean download. + +# git files +.gitattributes export-ignore +# .gitignore + +# helper config files +.travis.yml export-ignore +phpdoc.dist.xml export-ignore + +# Misc other files +readme.rst + +# They don't want all of our tests... +tests/codeigniter/ export-ignore +tests/travis/ export-ignore + +# User Guide Source Files +user_guide_src diff --git a/.gitignore b/.gitignore index 9edcfca6d..5982f9bad 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,15 @@ user_guide_src/cilexer/build/* user_guide_src/cilexer/dist/* user_guide_src/cilexer/pycilexer.egg-info/* /vendor/ -/nbproject/
\ No newline at end of file + +# IDE Files +#------------------------- +/nbproject/ +.idea/* + +## Sublime Text cache files +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache +*.sublime-workspace +*.sublime-project diff --git a/application/config/config.php b/application/config/config.php index f78371f13..94e5d28a9 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -192,8 +192,6 @@ $config['directory_trigger'] = 'd'; | Error Logging Threshold |-------------------------------------------------------------------------- | -| If you have enabled error logging, you can set an error threshold to -| determine what gets logged. Threshold options are: | You can enable error logging by setting a threshold over zero. The | threshold determines what gets logged. Threshold options are: | diff --git a/application/config/foreign_chars.php b/application/config/foreign_chars.php index d02dea958..ac406e3d4 100644 --- a/application/config/foreign_chars.php +++ b/application/config/foreign_chars.php @@ -56,6 +56,7 @@ $foreign_characters = array( '/ś|ŝ|ş|ș|š|ſ|σ|ς|с/' => 's', '/Ț|Ţ|Ť|Ŧ|τ|Т/' => 'T', '/ț|ţ|ť|ŧ|т/' => 't', + '/Þ|þ/' => 'th', '/Ù|Ú|Û|Ũ|Ū|Ŭ|Ů|Ű|Ų|Ư|Ǔ|Ǖ|Ǘ|Ǚ|Ǜ|Ũ|Ủ|Ụ|Ừ|Ứ|Ữ|Ử|Ự|У/' => 'U', '/ù|ú|û|ũ|ū|ŭ|ů|ű|ų|ư|ǔ|ǖ|ǘ|ǚ|ǜ|υ|ύ|ϋ|ủ|ụ|ừ|ứ|ữ|ử|ự|у/' => 'u', '/Ý|Ÿ|Ŷ|Υ|Ύ|Ϋ|Ỳ|Ỹ|Ỷ|Ỵ|Й/' => 'Y', diff --git a/application/config/mimes.php b/application/config/mimes.php index 8eff4d2d5..98a6fde97 100644 --- a/application/config/mimes.php +++ b/application/config/mimes.php @@ -127,7 +127,7 @@ return array( 'rsa' => 'application/x-pkcs7', 'cer' => array('application/pkix-cert', 'application/x-x509-ca-cert'), '3g2' => 'video/3gpp2', - '3gp' => 'video/3gp', + '3gp' => array('video/3gp', 'video/3gpp'), 'mp4' => 'video/mp4', 'm4a' => 'audio/x-m4a', 'f4v' => 'video/mp4', diff --git a/application/config/user_agents.php b/application/config/user_agents.php index 6f3295a70..2fd955435 100644 --- a/application/config/user_agents.php +++ b/application/config/user_agents.php @@ -62,6 +62,7 @@ $platforms = array( $browsers = array( 'OPR' => 'Opera', 'Flock' => 'Flock', + 'Edge' => 'Spartan', 'Chrome' => 'Chrome', // Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string 'Opera.*?Version' => 'Opera', diff --git a/composer.json b/composer.json index 4ff60c57e..0653a7885 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,15 @@ { - "description" : "The CodeIgniter framework", - "name" : "codeigniter/framework", + "description": "The CodeIgniter framework", + "name": "codeigniter/framework", + "type": "project", + "homepage": "http://codeigniter.com", "license": "MIT", + "support": { + "forum": "http://forum.codeigniter.com/", + "wiki": "https://github.com/bcit-ci/CodeIgniter/wiki", + "irc": "irc://irc.freenode.net/codeigniter", + "source": "https://github.com/bcit-ci/CodeIgniter" + }, "require": { "php": ">=5.2.4" }, diff --git a/system/core/Common.php b/system/core/Common.php index f28272b5b..b850fd39a 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -181,7 +181,7 @@ if ( ! function_exists('load_class')) // Did we find the class? if ($name === FALSE) { - // Note: We use exit() rather then show_error() in order to avoid a + // Note: We use exit() rather than show_error() in order to avoid a // self-referencing loop with the Exceptions class set_status_header(503); echo 'Unable to locate the specified class: '.$class.'.php'; @@ -506,6 +506,9 @@ if ( ! function_exists('set_status_header')) { is_int($code) OR $code = (int) $code; $stati = array( + 100 => 'Continue', + 101 => 'Switching Protocols', + 200 => 'OK', 201 => 'Created', 202 => 'Accepted', @@ -524,6 +527,7 @@ if ( ! function_exists('set_status_header')) 400 => 'Bad Request', 401 => 'Unauthorized', + 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', @@ -745,7 +749,7 @@ if ( ! function_exists('html_escape')) { return $var; } - + if (is_array($var)) { return array_map('html_escape', $var, array_fill(0, count($var), $double_encode)); diff --git a/system/core/Output.php b/system/core/Output.php index 02f66936c..e7d559a1d 100644 --- a/system/core/Output.php +++ b/system/core/Output.php @@ -674,7 +674,7 @@ class CI_Output { $cache_info = unserialize($match[1]); $expire = $cache_info['expire']; - $last_modified = filemtime($cache_path); + $last_modified = filemtime($filepath); // Has the file expired? if ($_SERVER['REQUEST_TIME'] >= $expire && is_really_writable($cache_path)) diff --git a/system/core/Router.php b/system/core/Router.php index eb3da2285..f91d3f6ec 100644 --- a/system/core/Router.php +++ b/system/core/Router.php @@ -493,7 +493,7 @@ class CI_Router { * Set directory name * * @param string $dir Directory name - * @param bool $appent Whether we're appending rather then setting the full value + * @param bool $appent Whether we're appending rather than setting the full value * @return void */ public function set_directory($dir, $append = FALSE) diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php index 3d35c2d70..64ee880c8 100644 --- a/system/database/DB_driver.php +++ b/system/database/DB_driver.php @@ -1218,7 +1218,7 @@ abstract class CI_DB_driver { /** * Fetch Field Names * - * @param string the table name + * @param string $table Table name * @return array */ public function list_fields($table) diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php index a77ed57d0..8251f4558 100644 --- a/system/database/DB_query_builder.php +++ b/system/database/DB_query_builder.php @@ -918,6 +918,8 @@ abstract class CI_DB_query_builder extends CI_DB_driver { } is_bool($escape) OR $escape = $this->_protect_identifiers; + // lowercase $side in case somebody writes e.g. 'BEFORE' instead of 'before' (doh) + $side = strtolower($side); foreach ($field as $k => $v) { @@ -925,9 +927,6 @@ abstract class CI_DB_query_builder extends CI_DB_driver { ? $this->_group_get_type('') : $this->_group_get_type($type); $v = $this->escape_like_str($v); - - // lowercase $side for in case of UPPERCASE string - $side = strtolower($side); if ($side === 'none') { @@ -2256,7 +2255,7 @@ abstract class CI_DB_query_builder extends CI_DB_driver { else { // Cycle through the "select" portion of the query and prep each column name. - // The reason we protect identifiers here rather then in the select() function + // The reason we protect identifiers here rather than in the select() function // is because until the user calls the from() function we don't know if there are aliases foreach ($this->qb_select as $key => $val) { diff --git a/system/database/drivers/oci8/oci8_driver.php b/system/database/drivers/oci8/oci8_driver.php index 4010995a1..b5cf26536 100644 --- a/system/database/drivers/oci8/oci8_driver.php +++ b/system/database/drivers/oci8/oci8_driver.php @@ -573,7 +573,7 @@ class CI_DB_oci8_driver extends CI_DB { { $default = ''; } - $retval[$i]->default = $query[$i]->COLUMN_DEFAULT; + $retval[$i]->default = $default; } return $retval; diff --git a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php index 67dc5f5ec..206d83595 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php @@ -157,6 +157,30 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver { // -------------------------------------------------------------------- /** + * Select the database + * + * @param string $database + * @return bool + */ + public function db_select($database = '') + { + if ($database === '') + { + $database = $this->database; + } + + if (FALSE !== $this->simple_query('USE '.$this->escape_identifiers($database))) + { + $this->database = $database; + return TRUE; + } + + return FALSE; + } + + // -------------------------------------------------------------------- + + /** * Show table query * * Generates a platform-specific query string so that the table names can be fetched diff --git a/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php b/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php index f07f49f84..d5ca741fd 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php @@ -121,17 +121,31 @@ class CI_DB_pdo_sqlite_driver extends CI_DB_pdo_driver { // -------------------------------------------------------------------- /** - * Show column query + * Fetch Field Names * - * Generates a platform-specific query string so that the column names can be fetched - * - * @param string $table - * @return string + * @param string $table Table name + * @return array */ - protected function _list_columns($table = '') + public function list_fields($table) { - // Not supported - return FALSE; + // Is there a cached result? + if (isset($this->data_cache['field_names'][$table])) + { + return $this->data_cache['field_names'][$table]; + } + + if (($result = $this->query('PRAGMA TABLE_INFO('.$this->protect_identifiers($table, TRUE, NULL, FALSE).')')) === FALSE) + { + return FALSE; + } + + $this->data_cache['field_names'][$table] = array(); + foreach ($result as $row) + { + $this->data_cache['field_names'][$table][] = $row['name']; + } + + return $this->data_cache['field_names'][$table]; } // -------------------------------------------------------------------- diff --git a/system/database/drivers/sqlite3/sqlite3_driver.php b/system/database/drivers/sqlite3/sqlite3_driver.php index fdbe94939..a7c6420bb 100644 --- a/system/database/drivers/sqlite3/sqlite3_driver.php +++ b/system/database/drivers/sqlite3/sqlite3_driver.php @@ -247,17 +247,31 @@ class CI_DB_sqlite3_driver extends CI_DB { // -------------------------------------------------------------------- /** - * Show column query + * Fetch Field Names * - * Generates a platform-specific query string so that the column names can be fetched - * - * @param string $table - * @return string + * @param string $table Table name + * @return array */ - protected function _list_columns($table = '') + public function list_fields($table) { - // Not supported - return FALSE; + // Is there a cached result? + if (isset($this->data_cache['field_names'][$table])) + { + return $this->data_cache['field_names'][$table]; + } + + if (($result = $this->query('PRAGMA TABLE_INFO('.$this->protect_identifiers($table, TRUE, NULL, FALSE).')')) === FALSE) + { + return FALSE; + } + + $this->data_cache['field_names'][$table] = array(); + foreach ($result as $row) + { + $this->data_cache['field_names'][$table][] = $row['name']; + } + + return $this->data_cache['field_names'][$table]; } // -------------------------------------------------------------------- diff --git a/system/helpers/array_helper.php b/system/helpers/array_helper.php index e07b52bb5..2ce55b9c4 100644 --- a/system/helpers/array_helper.php +++ b/system/helpers/array_helper.php @@ -62,7 +62,7 @@ if ( ! function_exists('element')) * @param mixed * @return mixed depends on what the array contains */ - function element($item, $array, $default = NULL) + function element($item, array $array, $default = NULL) { return array_key_exists($item, $array) ? $array[$item] : $default; } @@ -99,7 +99,7 @@ if ( ! function_exists('elements')) * @param mixed * @return mixed depends on what the array contains */ - function elements($items, $array, $default = NULL) + function elements($items, array $array, $default = NULL) { $return = array(); diff --git a/system/helpers/inflector_helper.php b/system/helpers/inflector_helper.php index d8ed45df9..f2890059f 100644 --- a/system/helpers/inflector_helper.php +++ b/system/helpers/inflector_helper.php @@ -133,6 +133,7 @@ if ( ! function_exists('plural')) } $plural_rules = array( + '/(quiz)$/' => '\1zes', // quizzes '/^(ox)$/' => '\1\2en', // ox '/([m|l])ouse$/' => '\1ice', // mouse, louse '/(matr|vert|ind)ix|ex$/' => '\1ices', // matrix, vertex, index diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index bf623b000..5f8c6ce67 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -161,7 +161,7 @@ if ( ! function_exists('anchor')) $site_url = is_array($uri) ? site_url($uri) - : preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri); + : (preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri)); if ($title === '') { diff --git a/system/libraries/Cache/Cache.php b/system/libraries/Cache/Cache.php index 40ac70103..215a7c528 100644 --- a/system/libraries/Cache/Cache.php +++ b/system/libraries/Cache/Cache.php @@ -100,28 +100,10 @@ class CI_Cache extends CI_Driver_Library { */ public function __construct($config = array()) { - $default_config = array( - 'adapter', - 'memcached' - ); - - foreach ($default_config as $key) - { - if (isset($config[$key])) - { - $param = '_'.$key; - - $this->{$param} = $config[$key]; - } - } - + isset($config['adapter']) && $this->_adapter = $config['adapter']; + isset($config['backup']) && $this->_backup_driver = $config['backup']; isset($config['key_prefix']) && $this->key_prefix = $config['key_prefix']; - if (isset($config['backup']) && in_array($config['backup'], $this->valid_drivers)) - { - $this->_backup_driver = $config['backup']; - } - // If the specified adapter isn't available, check the backup. if ( ! $this->is_supported($this->_adapter)) { diff --git a/system/libraries/Cache/drivers/Cache_redis.php b/system/libraries/Cache/drivers/Cache_redis.php index a35fbf6d2..66966ba16 100644 --- a/system/libraries/Cache/drivers/Cache_redis.php +++ b/system/libraries/Cache/drivers/Cache_redis.php @@ -125,9 +125,7 @@ class CI_Cache_redis extends CI_Driver $this->_redis->sRemove('_ci_redis_serialized', $id); } - return ($ttl) - ? $this->_redis->setex($id, $ttl, $data) - : $this->_redis->set($id, $data); + return $this->_redis->set($id, $data, $ttl); } // ------------------------------------------------------------------------ @@ -223,7 +221,7 @@ class CI_Cache_redis extends CI_Driver { $value = $this->get($key); - if ($value) + if ($value !== FALSE) { return array( 'expire' => time() + $this->_redis->ttl($key), @@ -270,7 +268,7 @@ class CI_Cache_redis extends CI_Driver if ($CI->config->load('redis', TRUE, TRUE)) { - $config += $CI->config->item('redis'); + $config = $CI->config->item('redis'); } $config = array_merge(self::$_default_config, $config); @@ -302,7 +300,11 @@ class CI_Cache_redis extends CI_Driver if (isset($config['password'])) { - $this->_redis->auth($config['password']); + if ( ! $this->_redis->auth($config['password'])) + { + log_message('debug', 'Cache: Redis authentication failed.'); + return FALSE; + } } // Initialize the index of serialized values. diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 05de59628..7599602c0 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -198,22 +198,20 @@ class CI_Form_validation { return $this; } - // No fields? Nothing to do... - if ( ! is_string($field) OR $field === '') + // No fields or no rules? Nothing to do... + if ( ! is_string($field) OR $field === '' OR empty($rules)) { return $this; } elseif ( ! is_array($rules)) { // BC: Convert pipe-separated rules string to an array - if (is_string($rules)) - { - $rules = explode('|', $rules); - } - else + if ( ! is_string($rules)) { return $this; } + + $rules = explode('|', $rules); } // If the field label wasn't passed we use the field name @@ -463,7 +461,7 @@ class CI_Form_validation { { $this->_field_data[$field]['postdata'] = $this->_reduce_array($validation_array, $row['keys']); } - elseif (isset($validation_array[$field]) && $validation_array[$field] !== '') + elseif (isset($validation_array[$field])) { $this->_field_data[$field]['postdata'] = $validation_array[$field]; } @@ -872,17 +870,11 @@ class CI_Form_validation { */ protected function _translate_fieldname($fieldname) { - // Do we need to translate the field name? - // We look for the prefix lang: to determine this - if (sscanf($fieldname, 'lang:%s', $line) === 1) + // Do we need to translate the field name? We look for the prefix 'lang:' to determine this + // If we find one, but there's no translation for the string - just return it + if (sscanf($fieldname, 'lang:%s', $line) === 1 && FALSE === ($fieldname = $this->CI->lang->line($line, FALSE))) { - // Were we able to translate the field name? If not we use $line - if (FALSE === ($fieldname = $this->CI->lang->line('form_validation_'.$line)) - // DEPRECATED support for non-prefixed keys - && FALSE === ($fieldname = $this->CI->lang->line($line, FALSE))) - { - return $line; - } + return $line; } return $fieldname; diff --git a/system/libraries/Ftp.php b/system/libraries/Ftp.php index af45bb55f..b53207577 100644 --- a/system/libraries/Ftp.php +++ b/system/libraries/Ftp.php @@ -490,7 +490,7 @@ class CI_FTP { // so we'll recursively call delete_dir() if ( ! preg_match('#/\.\.?$#', $list[$i]) && ! @ftp_delete($this->conn_id, $list[$i])) { - $this->delete_dir($list[$i]); + $this->delete_dir($filepath.$list[$i]); } } } diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index e056654bb..ce6c42b02 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -1055,8 +1055,11 @@ class CI_Image_lib { if ($this->rotation_angle === 'hor') { - for ($i = 0; $i < $height; $i++, $left = 0, $right = $width-1) + for ($i = 0; $i < $height; $i++) { + $left = 0; + $right = $width - 1; + while ($left < $right) { $cl = imagecolorat($src_img, $left, $i); @@ -1072,18 +1075,21 @@ class CI_Image_lib { } else { - for ($i = 0; $i < $width; $i++, $top = 0, $bot = $height-1) + for ($i = 0; $i < $width; $i++) { - while ($top < $bot) + $top = 0; + $bottom = $height - 1; + + while ($top < $bottom) { $ct = imagecolorat($src_img, $i, $top); - $cb = imagecolorat($src_img, $i, $bot); + $cb = imagecolorat($src_img, $i, $bottom); imagesetpixel($src_img, $i, $top, $cb); - imagesetpixel($src_img, $i, $bot, $ct); + imagesetpixel($src_img, $i, $bottom, $ct); $top++; - $bot--; + $bottom--; } } } diff --git a/system/libraries/Session/drivers/Session_memcached_driver.php b/system/libraries/Session/drivers/Session_memcached_driver.php index c7185ee44..97b860588 100644 --- a/system/libraries/Session/drivers/Session_memcached_driver.php +++ b/system/libraries/Session/drivers/Session_memcached_driver.php @@ -322,7 +322,7 @@ class CI_Session_memcached_driver extends CI_Session_driver implements SessionHa $this->_lock_key = $lock_key; break; } - while ($attempt++ < 30); + while (++$attempt < 30); if ($attempt === 30) { diff --git a/system/libraries/Session/drivers/Session_redis_driver.php b/system/libraries/Session/drivers/Session_redis_driver.php index 1ce101daf..b098cc441 100644 --- a/system/libraries/Session/drivers/Session_redis_driver.php +++ b/system/libraries/Session/drivers/Session_redis_driver.php @@ -336,7 +336,7 @@ class CI_Session_redis_driver extends CI_Session_driver implements SessionHandle $this->_lock_key = $lock_key; break; } - while ($attempt++ < 30); + while (++$attempt < 30); if ($attempt === 30) { diff --git a/tests/codeigniter/helpers/email_helper_test.php b/tests/codeigniter/helpers/email_helper_test.php index 53a206825..529e96910 100644 --- a/tests/codeigniter/helpers/email_helper_test.php +++ b/tests/codeigniter/helpers/email_helper_test.php @@ -13,6 +13,7 @@ class Email_helper_test extends CI_TestCase { $this->assertEquals(FALSE, valid_email('test@test@test.com')); $this->assertEquals(TRUE, valid_email('test@test.com')); $this->assertEquals(TRUE, valid_email('my.test@test.com')); + $this->assertEquals(TRUE, valid_email('my.test@subdomain.test.com')); } public function test_send_mail() diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 8fa4d1ef1..15be738d6 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -11,10 +11,24 @@ Release Date: Not Released - Added DoS mitigation to :php:func:`hash_pbkdf2()` :doc:`compatibility function <general/compatibility_functions>`. +- Database + + - Added ``list_fields()`` support for SQLite ('sqlite3' and 'pdo_sqlite' drivers). + Bug fixes for 3.0.1 ------------------- - Fixed a bug (#3733) - Autoloading of libraries with aliases didn't work, although it was advertised to. +- Fixed a bug (#3744) - Redis :doc:`Caching <libraries/caching>` driver didn't handle authentication failures properly. +- Fixed a bug (#3761) - :doc:`URL Helper <helpers/url_helper>` function :php:func:`anchor()` didn't work with array inputs. +- Fixed a bug (#3773) - ``db_select()`` didn't work for MySQL with the PDO :doc:`Database <database/index>` driver. +- Fixed a bug (#3771) - :doc:`Form Validation Library <libraries/form_validation>` was looking for a 'form_validation_' prefix when trying to translate field name labels. +- Fixed a bug (#3787) - :doc:`FTP Library <libraries/ftp>` method ``delete_dir()`` failed when the target has subdirectories. +- Fixed a bug (#3801) - :doc:`Output Library <libraries/output>` method ``_display_cache()`` incorrectly looked for the last modified time of a directory instead of the cache file. +- Fixed a bug (#3816) - :doc:`Form Validation Library <libraries/form_validation>` treated empty string values as non-existing ones. +- Fixed a bug (#3823) - :doc:`Session Library <libraries/sessions>` drivers Redis and Memcached didn't properly handle locks that are blocking the request for more than 30 seconds. +- Fixed a bug (#3846) - :doc:`Image Manipulation Library <libraries/image_lib>` method `image_mirror_gd()` didn't properly initialize its variables. +- Fixed a bug (#3854) - `field_data()` didn't work properly with the Oracle (OCI8) database driver. Version 3.0.0 ============= diff --git a/user_guide_src/source/database/utilities.rst b/user_guide_src/source/database/utilities.rst index cc4aeb018..81b949dd7 100644 --- a/user_guide_src/source/database/utilities.rst +++ b/user_guide_src/source/database/utilities.rst @@ -18,7 +18,7 @@ Initializing the Utility Class Load the Utility Class as follows:: - $this->load->dbutil() + $this->load->dbutil(); You can also pass another database object to the DB Utility loader, in case the database you want to manage isn't the default one:: @@ -35,7 +35,7 @@ assigning it directly to ``$this->dbutil``. Once initialized you will access the methods using the ``$this->dbutil`` object:: - $this->dbutil->some_method() + $this->dbutil->some_method(); **************************** Using the Database Utilities diff --git a/user_guide_src/source/general/controllers.rst b/user_guide_src/source/general/controllers.rst index bc8319dd8..7ab5a7f6a 100644 --- a/user_guide_src/source/general/controllers.rst +++ b/user_guide_src/source/general/controllers.rst @@ -138,7 +138,7 @@ present, as will be the case when only your site root URL is requested. To specify a default controller, open your **application/config/routes.php** file and set this variable:: - $route['default_controller'] = 'Blog'; + $route['default_controller'] = 'blog'; Where Blog is the name of the controller class you want used. If you now load your main index.php file without specifying any URI segments you'll diff --git a/user_guide_src/source/general/environments.rst b/user_guide_src/source/general/environments.rst index f5a4f617e..7f030b6ef 100644 --- a/user_guide_src/source/general/environments.rst +++ b/user_guide_src/source/general/environments.rst @@ -48,5 +48,5 @@ Configuration Files Optionally, you can have CodeIgniter load environment-specific configuration files. This may be useful for managing things like differing API keys across multiple environments. This is described in -more detail in the environment section of the :doc:`Config -Class <../libraries/config#environments>`_ documentation.
\ No newline at end of file +more detail in the environment section of the :doc:`Config Class +<../libraries/config>`_ documentation.
\ No newline at end of file diff --git a/user_guide_src/source/general/reserved_names.rst b/user_guide_src/source/general/reserved_names.rst index a7b0c3465..5d745cba6 100644 --- a/user_guide_src/source/general/reserved_names.rst +++ b/user_guide_src/source/general/reserved_names.rst @@ -75,6 +75,7 @@ Constants - FOPEN_READ_WRITE_CREATE - FOPEN_WRITE_CREATE_STRICT - FOPEN_READ_WRITE_CREATE_STRICT +- SHOW_DEBUG_BACKTRACE - EXIT_SUCCESS - EXIT_ERROR - EXIT_CONFIG diff --git a/user_guide_src/source/helpers/date_helper.rst b/user_guide_src/source/helpers/date_helper.rst index e0f9f0033..a85da26a4 100644 --- a/user_guide_src/source/helpers/date_helper.rst +++ b/user_guide_src/source/helpers/date_helper.rst @@ -400,7 +400,7 @@ UM10 (UTC - 10:00) Hawaii-Aleutian Standard Time, Cook Islands UM95 (UTC - 09:30) Marquesas Islands UM9 (UTC - 09:00) Alaska Standard Time, Gambier Islands UM8 (UTC - 08:00) Pacific Standard Time, Clipperton Island -UM7 (UTC - 11:00) Mountain Standard Time +UM7 (UTC - 07:00) Mountain Standard Time UM6 (UTC - 06:00) Central Standard Time UM5 (UTC - 05:00) Eastern Standard Time, Western Caribbean UM45 (UTC - 04:30) Venezuelan Standard Time diff --git a/user_guide_src/source/libraries/caching.rst b/user_guide_src/source/libraries/caching.rst index f54de5faf..a7081ec6b 100644 --- a/user_guide_src/source/libraries/caching.rst +++ b/user_guide_src/source/libraries/caching.rst @@ -18,7 +18,7 @@ requirements are not met. Example Usage ************* -The following example will load the cache driver, specify `APC <#apc>`_ +The following example will load the cache driver, specify `APC <#alternative-php-cache-apc-caching>`_ as the driver to use, and fall back to file-based caching if APC is not available in the hosting environment. @@ -66,7 +66,7 @@ Class Reference hosting environment. :: - if ($this->cache->apc->is_supported() + if ($this->cache->apc->is_supported()) { if ($data = $this->cache->apc->get('my_cache')) { diff --git a/user_guide_src/source/libraries/config.rst b/user_guide_src/source/libraries/config.rst index 3138e3403..a45cacdf5 100644 --- a/user_guide_src/source/libraries/config.rst +++ b/user_guide_src/source/libraries/config.rst @@ -92,9 +92,9 @@ Fetching Config Items To retrieve an item from your config file, use the following function:: - $this->config->item('item name'); + $this->config->item('item_name'); -Where item name is the $config array index you want to retrieve. For +Where item_name is the $config array index you want to retrieve. For example, to fetch your language choice you'll do this:: $lang = $this->config->item('language'); diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index da43a4bec..dbf1e8a63 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -946,6 +946,7 @@ Rule Parameter Description ========================= ========== ============================================================================================= ======================= **required** No Returns FALSE if the form element is empty. **matches** Yes Returns FALSE if the form element does not match the one in the parameter. matches[form_item] +**regex_match** Yes Returns FALSE if the form element does not match the regular expression. regex_match[/regex/] **differs** Yes Returns FALSE if the form element does not differ from the one in the parameter. differs[form_item] **is_unique** Yes Returns FALSE if the form element is not unique to the table and field name in the is_unique[table.field] parameter. Note: This rule requires :doc:`Query Builder <../database/query_builder>` to be diff --git a/user_guide_src/source/libraries/migration.rst b/user_guide_src/source/libraries/migration.rst index 25be0c93c..9eb9b78b1 100644 --- a/user_guide_src/source/libraries/migration.rst +++ b/user_guide_src/source/libraries/migration.rst @@ -88,7 +88,7 @@ as *20121031100537_add_blog.php*. } } -Then in **application/config/migration.php** set ``$config['migration_version'] = 1;``. +Then in **application/config/migration.php** set ``$config['migration_version'] = 20121031100537;``. ************* Usage Example @@ -181,4 +181,4 @@ Class Reference specific versions. It works just like ``current()`` but ignores ``$config['migration_version']``. :: - $this->migration->version(5);
\ No newline at end of file + $this->migration->version(5); diff --git a/user_guide_src/source/libraries/security.rst b/user_guide_src/source/libraries/security.rst index ac56fc589..16b397994 100644 --- a/user_guide_src/source/libraries/security.rst +++ b/user_guide_src/source/libraries/security.rst @@ -88,7 +88,7 @@ may alter this behavior by editing the following config parameter :: - $config['csrf_regeneration'] = TRUE; + $config['csrf_regenerate'] = TRUE; Select URIs can be whitelisted from csrf protection (for example API endpoints expecting externally POSTed content). You can add these URIs diff --git a/user_guide_src/source/overview/features.rst b/user_guide_src/source/overview/features.rst index b230be9a3..f62546b61 100644 --- a/user_guide_src/source/overview/features.rst +++ b/user_guide_src/source/overview/features.rst @@ -8,8 +8,8 @@ how intuitively or intelligently it is designed. Features don't reveal anything about the quality of the code, or the performance, or the attention to detail, or security practices. The only way to really judge an app is to try it and get to know the code. -:doc:`Installing <../installation/>`_ CodeIgniter is child's play so we -encourage you to do just that. In the mean time here's a list of +:doc:`Installing <../installation/index>` CodeIgniter is child's play so +we encourage you to do just that. In the mean time here's a list of CodeIgniter's main features. - Model-View-Controller Based System diff --git a/user_guide_src/source/tutorial/create_news_items.rst b/user_guide_src/source/tutorial/create_news_items.rst index 71d2080af..5c5270472 100644 --- a/user_guide_src/source/tutorial/create_news_items.rst +++ b/user_guide_src/source/tutorial/create_news_items.rst @@ -18,11 +18,11 @@ application/views/news/create.php. :: - <h2><?php echo $title ?></h2> + <h2><?php echo $title; ?></h2> <?php echo validation_errors(); ?> - <?php echo form_open('news/create') ?> + <?php echo form_open('news/create'); ?> <label for="title">Title</label> <input type="input" name="title" /><br /> diff --git a/user_guide_src/source/tutorial/news_section.rst b/user_guide_src/source/tutorial/news_section.rst index d8ebac4a3..688f2cb19 100644 --- a/user_guide_src/source/tutorial/news_section.rst +++ b/user_guide_src/source/tutorial/news_section.rst @@ -143,17 +143,17 @@ and add the next piece of code. :: - <h2><?php echo $title ?></h2> + <h2><?php echo $title; ?></h2> <?php foreach ($news as $news_item): ?> - <h3><?php echo $news_item['title'] ?></h3> + <h3><?php echo $news_item['title']; ?></h3> <div class="main"> - <?php echo $news_item['text'] ?> + <?php echo $news_item['text']; ?> </div> - <p><a href="<?php echo $news_item['slug'] ?>">View article</a></p> + <p><a href="<?php echo $news_item['slug']; ?>">View article</a></p> - <?php endforeach ?> + <?php endforeach; ?> Here, each news item is looped and displayed to the user. You can see we wrote our template in PHP mixed with HTML. If you prefer to use a diff --git a/user_guide_src/source/tutorial/static_pages.rst b/user_guide_src/source/tutorial/static_pages.rst index 62b3469ad..e948d3011 100644 --- a/user_guide_src/source/tutorial/static_pages.rst +++ b/user_guide_src/source/tutorial/static_pages.rst @@ -64,7 +64,7 @@ following code. </head> <body> - <h1><?php echo $title ?></h1> + <h1><?php echo $title; ?></h1> The header contains the basic HTML code that you'll want to display before loading the main view, together with a heading. It will also |