From b5a5d76d0733780c846963592ff813f867beaf97 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 12 Mar 2016 16:34:30 +0200 Subject: Merge pull request #4532 from Tpojka/develop [ci skip] Remove an unnecessary slash from a documentation example --- user_guide_src/source/tutorial/static_pages.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/tutorial/static_pages.rst b/user_guide_src/source/tutorial/static_pages.rst index 569287c98..5daaa958f 100644 --- a/user_guide_src/source/tutorial/static_pages.rst +++ b/user_guide_src/source/tutorial/static_pages.rst @@ -97,7 +97,7 @@ page actually exists: public function view($page = 'home') { - if ( ! file_exists(APPPATH.'/views/pages/'.$page.'.php')) + if ( ! file_exists(APPPATH.'views/pages/'.$page.'.php')) { // Whoops, we don't have a page for that! show_404(); -- cgit v1.2.3-24-g4f1b From 4f555079a6d85abd11403c72b9dbaa8823dc2e6d Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 12 Mar 2016 17:21:55 +0200 Subject: [ci skip] Deprecate prep_for_form() in Form_validation --- system/libraries/Form_validation.php | 7 ++++--- user_guide_src/source/changelog.rst | 1 + user_guide_src/source/installation/upgrade_306.rst | 19 +++++++++++++++++++ user_guide_src/source/libraries/form_validation.rst | 8 ++++---- 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 9fb686892..6be593add 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -1515,10 +1515,11 @@ class CI_Form_validation { * This function allows HTML to be safely shown in a form. * Special characters are converted. * - * @param string - * @return string + * @deprecated 3.0.6 Not used anywhere within the framework and pretty much useless + * @param mixed $data Input data + * @return mixed */ - public function prep_for_form($data = '') + public function prep_for_form($data) { if ($this->_safe_form_data === FALSE OR empty($data)) { diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index de488a995..e88b68f85 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -10,6 +10,7 @@ Release Date: Not Released - General Changes - Added a destructor to :doc:`Cache Library ` 'memcached' driver to ensure that Memcache(d) connections are properly closed. + - Deprecated :doc:`Form Validation Library ` method ``prep_for_form()``. Bug fixes for 3.0.6 ------------------- diff --git a/user_guide_src/source/installation/upgrade_306.rst b/user_guide_src/source/installation/upgrade_306.rst index e9c4bdd79..f6d2f13d4 100644 --- a/user_guide_src/source/installation/upgrade_306.rst +++ b/user_guide_src/source/installation/upgrade_306.rst @@ -12,3 +12,22 @@ Replace all files and directories in your *system/* directory. .. note:: If you have any custom developed files in these directories, please make copies of them first. + +Step 2: Remove 'prep_for_form' usage (deprecation) +================================================== + +The :doc:`Form Validation Library <../libraries/form_validation>` has a +``prep_for_form()`` method, which is/can also be used as a rule in +``set_rules()`` to automatically perform HTML encoding on input data. + +Automatically encoding input (instead of output) data is a bad practice in +the first place, and CodeIgniter and PHP itself offer other alternatives +to this method anyway. +For example, :doc:`Form Helper <../helpers/form_helper>` functions will +automatically perform HTML escaping when necessary. + +Therefore, the *prep_for_form* method/rule is pretty much useless and is now +deprecated and scheduled for removal in 3.1+. + +.. note:: The method is still available, but you're strongly encouraged to + remove its usage sooner rather than later. diff --git a/user_guide_src/source/libraries/form_validation.rst b/user_guide_src/source/libraries/form_validation.rst index 9189d082e..44adfd715 100644 --- a/user_guide_src/source/libraries/form_validation.rst +++ b/user_guide_src/source/libraries/form_validation.rst @@ -1007,14 +1007,14 @@ Prepping Reference The following is a list of all the prepping methods that are available to use: -==================== ========= ======================================================================================================= +==================== ========= ============================================================================================================== Name Parameter Description -==================== ========= ======================================================================================================= -**prep_for_form** No Converts special characters so that HTML data can be shown in a form field without breaking it. +==================== ========= ============================================================================================================== +**prep_for_form** No DEPRECATED: Converts special characters so that HTML data can be shown in a form field without breaking it. **prep_url** No Adds "\http://" to URLs if missing. **strip_image_tags** No Strips the HTML from image tags leaving the raw URL. **encode_php_tags** No Converts PHP tags to entities. -==================== ========= ======================================================================================================= +==================== ========= ============================================================================================================== .. note:: You can also use any native PHP functions that permits one parameter, like ``trim()``, ``htmlspecialchars()``, ``urldecode()``, -- cgit v1.2.3-24-g4f1b From 2961883c06ba963a67a68c34ef90a57ff5c38646 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 12 Mar 2016 20:01:57 +0200 Subject: [ci skip] Update the index.php file - Use DIRECTORY_SEPARATOR instead of a hard-coded forward-slash - Use more proper terminology in comment descriptions - Small tweaks to directory detection logic --- index.php | 125 ++++++++++++--------- user_guide_src/source/installation/upgrade_306.rst | 17 ++- 2 files changed, 90 insertions(+), 52 deletions(-) diff --git a/index.php b/index.php index 5cc37108a..6986e1e5d 100755 --- a/index.php +++ b/index.php @@ -91,24 +91,25 @@ switch (ENVIRONMENT) /* *--------------------------------------------------------------- - * SYSTEM FOLDER NAME + * SYSTEM DIRCTORY NAME *--------------------------------------------------------------- * - * This variable must contain the name of your "system" folder. - * Include the path if the folder is not in the same directory - * as this file. + * This variable must contain the name of your "system" directory. + * Set the path if it is not in the same directory as this file. */ $system_path = 'system'; /* *--------------------------------------------------------------- - * APPLICATION FOLDER NAME + * APPLICATION DIRECTORY NAME *--------------------------------------------------------------- * * If you want this front controller to use a different "application" - * folder than the default one you can set its name here. The folder - * can also be renamed or relocated anywhere on your server. If - * you do, use a full server path. For more info please see the user guide: + * directory than the default one you can set its name here. The directory + * can also be renamed or relocated anywhere on your server. If you do, + * use an absolute (full) server path. + * For more info please see the user guide: + * * https://codeigniter.com/user_guide/general/managing_apps.html * * NO TRAILING SLASH! @@ -117,14 +118,14 @@ switch (ENVIRONMENT) /* *--------------------------------------------------------------- - * VIEW FOLDER NAME + * VIEW DIRECTORY NAME *--------------------------------------------------------------- * - * If you want to move the view folder out of the application - * folder set the path to the folder here. The folder can be renamed + * If you want to move the view directory out of the application + * directory, set the path to it here. The directory can be renamed * and relocated anywhere on your server. If blank, it will default - * to the standard location inside your application folder. If you - * do move this, use the full server path to this folder. + * to the standard location inside your application directory. + * If you do move this, use an absolute (full) server path. * * NO TRAILING SLASH! */ @@ -150,8 +151,8 @@ switch (ENVIRONMENT) * * Un-comment the $routing array below to use this feature */ - // The directory name, relative to the "controllers" folder. Leave blank - // if your controller is not in a sub-folder within the "controllers" folder + // The directory name, relative to the "controllers" directory. Leave blank + // if your controller is not in a sub-directory within the "controllers" one // $routing['directory'] = ''; // The controller class file name. Example: mycontroller @@ -197,12 +198,16 @@ switch (ENVIRONMENT) if (($_temp = realpath($system_path)) !== FALSE) { - $system_path = $_temp.'/'; + $system_path = $_temp.DIRECTORY_SEPARATOR; } else { // Ensure there's a trailing slash - $system_path = rtrim($system_path, '/').'/'; + $system_path = strtr( + rtrim($system_path, '/\\'), + '/\\', + DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR + ).DIRECTORY_SEPARATOR; } // Is the system path correct? @@ -221,66 +226,84 @@ switch (ENVIRONMENT) // The name of THIS file define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME)); - // Path to the system folder - define('BASEPATH', str_replace('\\', '/', $system_path)); + // Path to the system directory + define('BASEPATH', $system_path); - // Path to the front controller (this file) - define('FCPATH', dirname(__FILE__).'/'); + // Path to the front controller (this file) directory + define('FCPATH', dirname(__FILE__).DIRECTORY_SEPARATOR); - // Name of the "system folder" - define('SYSDIR', trim(strrchr(trim(BASEPATH, '/'), '/'), '/')); + // Name of the "system" directory + define('SYSDIR', basename(BASEPATH)); - // The path to the "application" folder + // The path to the "application" directory if (is_dir($application_folder)) { if (($_temp = realpath($application_folder)) !== FALSE) { - $application_folder = $_temp; + $application_folder = $_temp.DIRECTORY_SEPARATOR; + } + else + { + $application_folder = strtr( + rtrim($application_folder, '/\\'), + '/\\', + DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR + ); } - - define('APPPATH', $application_folder.DIRECTORY_SEPARATOR); + } + elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) + { + $application_folder = BASEPATH.strtr( + trim($application_folder, '/\\'), + '/\\', + DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR + ); } else { - if ( ! is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR)) - { - header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); - echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; - exit(3); // EXIT_CONFIG - } - - define('APPPATH', BASEPATH.$application_folder.DIRECTORY_SEPARATOR); + header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); + echo 'Your application folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; + exit(3); // EXIT_CONFIG } - // The path to the "views" folder - if ( ! is_dir($view_folder)) + define('APPPATH', $application_folder.DIRECTORY_SEPARATOR); + + // The path to the "views" directory + if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) { - if ( ! empty($view_folder) && is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) - { - $view_folder = APPPATH.$view_folder; - } - elseif ( ! is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR)) + $view_folder = APPPATH.'views'; + } + elseif (is_dir($view_folder)) + { + if (($_temp = realpath($view_folder)) !== FALSE) { - header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); - echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; - exit(3); // EXIT_CONFIG + $view_folder = $_temp; } else { - $view_folder = APPPATH.'views'; + $view_folder = strtr( + rtrim($view_folder, '/\\'), + '/\\', + DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR + ); } } - - if (($_temp = realpath($view_folder)) !== FALSE) + elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR)) { - $view_folder = $_temp.DIRECTORY_SEPARATOR; + $view_folder = APPPATH.strtr( + trim($view_folder, '/\\'), + '/\\', + DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR + ); } else { - $view_folder = rtrim($view_folder, '/\\').DIRECTORY_SEPARATOR; + header('HTTP/1.1 503 Service Unavailable.', TRUE, 503); + echo 'Your view folder path does not appear to be set correctly. Please open the following file and correct this: '.SELF; + exit(3); // EXIT_CONFIG } - define('VIEWPATH', $view_folder); + define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR); /* * -------------------------------------------------------------------- diff --git a/user_guide_src/source/installation/upgrade_306.rst b/user_guide_src/source/installation/upgrade_306.rst index f6d2f13d4..3863e0afa 100644 --- a/user_guide_src/source/installation/upgrade_306.rst +++ b/user_guide_src/source/installation/upgrade_306.rst @@ -13,7 +13,22 @@ Replace all files and directories in your *system/* directory. .. note:: If you have any custom developed files in these directories, please make copies of them first. -Step 2: Remove 'prep_for_form' usage (deprecation) +Step 2: Update your index.php file (optional) +============================================= + +We've made some tweaks to the index.php file, mostly related to proper +usage of directory separators (i.e. use the ``DIRECTORY_SEPARATOR`` +constant instead of a hard coded forward slash "/"). + +Nothing will break if you skip this step, but if you're running Windows +or just want to be up to date with every change - we do recommend that +you update your index.php file. + +*Tip: Just copy the ``ENVIRONMENT``, ``$system_path``, ``$application_folder`` +and ``$view_folder`` declarations from the old file and put them into the +new one, replacing the defaults.* + +Step 3: Remove 'prep_for_form' usage (deprecation) ================================================== The :doc:`Form Validation Library <../libraries/form_validation>` has a -- cgit v1.2.3-24-g4f1b From ca956162f5793527d7151bddd1fb223edbfed46b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sat, 12 Mar 2016 20:04:08 +0200 Subject: [ci skip] Revert an unnecessary change from last commit --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 6986e1e5d..7f9a777b5 100755 --- a/index.php +++ b/index.php @@ -240,7 +240,7 @@ switch (ENVIRONMENT) { if (($_temp = realpath($application_folder)) !== FALSE) { - $application_folder = $_temp.DIRECTORY_SEPARATOR; + $application_folder = $_temp; } else { -- cgit v1.2.3-24-g4f1b From a990a8d195a13dd38bdd1620391a4e1b40770952 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Sun, 13 Mar 2016 15:44:01 +0200 Subject: [ci skip] Fix a comment typo --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index 7f9a777b5..d02b6bb38 100755 --- a/index.php +++ b/index.php @@ -91,7 +91,7 @@ switch (ENVIRONMENT) /* *--------------------------------------------------------------- - * SYSTEM DIRCTORY NAME + * SYSTEM DIRECTORY NAME *--------------------------------------------------------------- * * This variable must contain the name of your "system" directory. -- cgit v1.2.3-24-g4f1b From 2c10f60586faf59b9380608c5a9bf01ff2522483 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 15 Mar 2016 14:39:02 +0200 Subject: Add __isset() to CI_Session --- system/libraries/Session/Session.php | 18 ++++++++++++++++++ user_guide_src/source/changelog.rst | 1 + 2 files changed, 19 insertions(+) diff --git a/system/libraries/Session/Session.php b/system/libraries/Session/Session.php index 77c56ae70..c9d2e8adc 100644 --- a/system/libraries/Session/Session.php +++ b/system/libraries/Session/Session.php @@ -583,6 +583,24 @@ class CI_Session { // ------------------------------------------------------------------------ + /** + * __isset() + * + * @param string $key 'session_id' or a session data key + * @return bool + */ + public function __isset($key) + { + if ($key === 'session_id') + { + return (session_status() === PHP_SESSION_ACTIVE); + } + + return isset($_SESSION[$key]); + } + + // ------------------------------------------------------------------------ + /** * __set() * diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index e88b68f85..e235d2e6a 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -16,6 +16,7 @@ Bug fixes for 3.0.6 ------------------- - Fixed a bug (#4516) - :doc:`Form Validation Library ` always accepted empty array inputs. +- Fixed a bug where :doc:`Session Library ` allowed accessing ``$_SESSION`` values as class properties but ``isset()`` didn't work on them. Version 3.0.5 ============= -- cgit v1.2.3-24-g4f1b From 5576d2ca40666ada969fb2cb951fbddf8ca4ad8e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 16 Mar 2016 12:16:45 +0200 Subject: Simplify a bit of internal code in CI_Form_validation --- system/libraries/Form_validation.php | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 6be593add..ed4b9bccb 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -527,10 +527,7 @@ class CI_Form_validation { { if ($row['is_array'] === FALSE) { - if (isset($_POST[$row['field']])) - { - $_POST[$row['field']] = $row['postdata']; - } + isset($_POST[$field]) && $_POST[$field] = $row['postdata']; } else { @@ -550,20 +547,7 @@ class CI_Form_validation { } } - if (is_array($row['postdata'])) - { - $array = array(); - foreach ($row['postdata'] as $k => $v) - { - $array[$k] = $v; - } - - $post_ref = $array; - } - else - { - $post_ref = $row['postdata']; - } + $post_ref = $row['postdata']; } } } -- cgit v1.2.3-24-g4f1b From 02ac187ce4789c5ab122a41e3b064ca923d98a82 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 16 Mar 2016 12:19:34 +0200 Subject: Fix a Form_validation bug that unnecessarily modifes $_POST --- system/libraries/Form_validation.php | 2 +- user_guide_src/source/changelog.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index ed4b9bccb..e4a518957 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -486,7 +486,7 @@ class CI_Form_validation { } // Now we need to re-set the POST data with the new, processed data - $this->_reset_post_array(); + empty($this->validation_data) && $this->_reset_post_array(); return ($total_errors === 0); } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index e235d2e6a..8203aba41 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -17,6 +17,7 @@ Bug fixes for 3.0.6 - Fixed a bug (#4516) - :doc:`Form Validation Library ` always accepted empty array inputs. - Fixed a bug where :doc:`Session Library ` allowed accessing ``$_SESSION`` values as class properties but ``isset()`` didn't work on them. +- Fixed a bug where :doc:`Form Validation Library ` modified the ``$_POST`` array when the data being validated was actually provided via ``set_data()``. Version 3.0.5 ============= -- cgit v1.2.3-24-g4f1b From f8490b994c959de3e1eabba27d8d919433e3fc70 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 16 Mar 2016 16:22:14 +0200 Subject: Fix #4539 --- system/libraries/Migration.php | 97 ++++++++++++++++++++++++------------- user_guide_src/source/changelog.rst | 2 + 2 files changed, 65 insertions(+), 34 deletions(-) diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 7aefb6c23..74bec3d60 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -96,9 +96,9 @@ class CI_Migration { /** * Migration basename regex * - * @var bool + * @var string */ - protected $_migration_regex = NULL; + protected $_migration_regex; /** * Error message @@ -217,31 +217,61 @@ class CI_Migration { if ($target_version > $current_version) { - // Moving Up $method = 'up'; } else { - // Moving Down, apply in reverse order $method = 'down'; + // We need this so that migrations are applied in reverse order krsort($migrations); } - if (empty($migrations)) - { - return TRUE; - } - - $previous = FALSE; - - // Validate all available migrations, and run the ones within our target range + // Validate all available migrations within our target range. + // + // Unfortunately, we'll have to use another loop to run them + // in order to avoid leaving the procedure in a broken state. + // + // See https://github.com/bcit-ci/CodeIgniter/issues/4539 + $pending = array(); foreach ($migrations as $number => $file) { + // Ignore versions out of our range. + // + // Because we've previously sorted the $migrations array depending on the direction, + // we can safely break the loop once we reach $target_version ... + if ($method === 'up') + { + if ($number <= $current_version) + { + continue; + } + elseif ($number > $target_version) + { + break; + } + } + else + { + if ($number > $current_version) + { + continue; + } + elseif ($number <= $target_version) + { + break; + } + } + // Check for sequence gaps - if ($this->_migration_type === 'sequential' && $previous !== FALSE && abs($number - $previous) > 1) + if ($this->_migration_type === 'sequential') { - $this->_error_string = sprintf($this->lang->line('migration_sequence_gap'), $number); - return FALSE; + if (isset($previous) && abs($number - $previous) > 1) + { + $this->_error_string = sprintf($this->lang->line('migration_sequence_gap'), $number); + return FALSE; + } + + $previous = $number; } include_once($file); @@ -253,27 +283,27 @@ class CI_Migration { $this->_error_string = sprintf($this->lang->line('migration_class_doesnt_exist'), $class); return FALSE; } + // method_exists() returns true for non-public methods, + // while is_callable() can't be used without instantiating. + // Only get_class_methods() satisfies both conditions. + elseif ( ! in_array($method, array_map('strtolower', get_class_methods($class)))) + { + $this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class); + return FALSE; + } - $previous = $number; + $pending[$number] = array($class, $method); + } - // Run migrations that are inside the target range - if ( - ($method === 'up' && $number > $current_version && $number <= $target_version) OR - ($method === 'down' && $number <= $current_version && $number > $target_version) - ) - { - $instance = new $class(); - if ( ! is_callable(array($instance, $method))) - { - $this->_error_string = sprintf($this->lang->line('migration_missing_'.$method.'_method'), $class); - return FALSE; - } + // Now just run the necessary migrations + foreach ($pending as $number => $migration) + { + log_message('debug', 'Migrating '.$method.' from version '.$current_version.' to version '.$number); - log_message('debug', 'Migrating '.$method.' from version '.$current_version.' to version '.$number); - call_user_func(array($instance, $method)); - $current_version = $number; - $this->_update_version($current_version); - } + $migration[0] = new $migration[0]; + call_user_func($migration); + $current_version = $number; + $this->_update_version($current_version); } // This is necessary when moving down, since the the last migration applied @@ -285,7 +315,6 @@ class CI_Migration { } log_message('debug', 'Finished migrating to '.$current_version); - return $current_version; } diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 8203aba41..b6d64fb8f 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -18,6 +18,8 @@ Bug fixes for 3.0.6 - Fixed a bug (#4516) - :doc:`Form Validation Library ` always accepted empty array inputs. - Fixed a bug where :doc:`Session Library ` allowed accessing ``$_SESSION`` values as class properties but ``isset()`` didn't work on them. - Fixed a bug where :doc:`Form Validation Library ` modified the ``$_POST`` array when the data being validated was actually provided via ``set_data()``. +- Fixed a bug (#4539) - :doc:`Migration Library ` applied migrations before validating that all migrations within the requested version range are valid. +- Fixed a bug (#4539) - :doc:`Migration Library ` triggered failures for migrations that are out of the requested version range. Version 3.0.5 ============= -- cgit v1.2.3-24-g4f1b From 3df07729b8018acd764a7a8a08f34f1579c43e5e Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Wed, 16 Mar 2016 21:15:52 +0200 Subject: A small Migrations tweak --- system/libraries/Migration.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/system/libraries/Migration.php b/system/libraries/Migration.php index 74bec3d60..316c94ae3 100644 --- a/system/libraries/Migration.php +++ b/system/libraries/Migration.php @@ -219,12 +219,17 @@ class CI_Migration { { $method = 'up'; } - else + elseif ($target_version < $current_version) { $method = 'down'; // We need this so that migrations are applied in reverse order krsort($migrations); } + else + { + // Well, there's nothing to migrate then ... + return TRUE; + } // Validate all available migrations within our target range. // -- cgit v1.2.3-24-g4f1b From 83dfab90b351ad575fb8b8b7c6ff4b2c287d1e9b Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Thu, 17 Mar 2016 18:09:50 +0200 Subject: Merge pull request #4544 from fulopm/develop [ci skip] Fix codeblock formatting in Zip library docs --- user_guide_src/source/libraries/zip.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/user_guide_src/source/libraries/zip.rst b/user_guide_src/source/libraries/zip.rst index 816f49ca1..9704d5b1d 100644 --- a/user_guide_src/source/libraries/zip.rst +++ b/user_guide_src/source/libraries/zip.rst @@ -24,7 +24,7 @@ your controller using the $this->load->library function:: $this->load->library('zip'); -Once loaded, the Zip library object will be available using: +Once loaded, the Zip library object will be available using:: $this->zip -- cgit v1.2.3-24-g4f1b From 9de0f0b3a65bea6adff9999977ea6b717099e194 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 21 Mar 2016 18:22:33 +0200 Subject: [ci skip] Prepare for 3.0.6 release --- system/core/CodeIgniter.php | 2 +- user_guide_src/source/changelog.rst | 2 +- user_guide_src/source/conf.py | 4 ++-- user_guide_src/source/installation/downloads.rst | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index f0d7c8f53..3eb3e0573 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.6-dev'); + define('CI_VERSION', '3.0.6'); /* * ------------------------------------------------------ diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index b6d64fb8f..86f51ca58 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -5,7 +5,7 @@ Change Log Version 3.0.6 ============= -Release Date: Not Released +Release Date: March 21, 2016 - General Changes diff --git a/user_guide_src/source/conf.py b/user_guide_src/source/conf.py index e4d14d100..4fa2f01ba 100644 --- a/user_guide_src/source/conf.py +++ b/user_guide_src/source/conf.py @@ -48,9 +48,9 @@ copyright = u'2014 - 2016, British Columbia Institute of Technology' # built documents. # # The short X.Y version. -version = '3.0.6-dev' +version = '3.0.6' # The full version, including alpha/beta/rc tags. -release = '3.0.6-dev' +release = '3.0.6' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/user_guide_src/source/installation/downloads.rst b/user_guide_src/source/installation/downloads.rst index be33a1dc9..979e4c20f 100644 --- a/user_guide_src/source/installation/downloads.rst +++ b/user_guide_src/source/installation/downloads.rst @@ -2,7 +2,7 @@ Downloading CodeIgniter ####################### -- `CodeIgniter v3.0.6-dev (Current version) `_ +- `CodeIgniter v3.0.6 (Current version) `_ - `CodeIgniter v3.0.5 `_ - `CodeIgniter v3.0.4 `_ - `CodeIgniter v3.0.3 `_ -- cgit v1.2.3-24-g4f1b From eb373a1abb348515001123ecbaca5e5384e69d19 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Mon, 21 Mar 2016 18:30:06 +0200 Subject: [ci skip] Mark the start of 3.0.7 development --- system/core/CodeIgniter.php | 2 +- user_guide_src/source/changelog.rst | 6 ++++++ user_guide_src/source/conf.py | 4 ++-- user_guide_src/source/installation/downloads.rst | 3 ++- user_guide_src/source/installation/upgrade_307.rst | 14 ++++++++++++++ user_guide_src/source/installation/upgrading.rst | 1 + 6 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 user_guide_src/source/installation/upgrade_307.rst diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php index 3eb3e0573..f0d7c8f53 100644 --- a/system/core/CodeIgniter.php +++ b/system/core/CodeIgniter.php @@ -55,7 +55,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); * @var string * */ - define('CI_VERSION', '3.0.6'); + define('CI_VERSION', '3.0.6-dev'); /* * ------------------------------------------------------ diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst index 86f51ca58..341415f14 100644 --- a/user_guide_src/source/changelog.rst +++ b/user_guide_src/source/changelog.rst @@ -2,6 +2,12 @@ Change Log ########## +Version 3.0.7 +============= + +Release Date: Not Released + + Version 3.0.6 ============= diff --git a/user_guide_src/source/conf.py b/user_guide_src/source/conf.py index 4fa2f01ba..26f854d85 100644 --- a/user_guide_src/source/conf.py +++ b/user_guide_src/source/conf.py @@ -48,9 +48,9 @@ copyright = u'2014 - 2016, British Columbia Institute of Technology' # built documents. # # The short X.Y version. -version = '3.0.6' +version = '3.0.7-dev' # The full version, including alpha/beta/rc tags. -release = '3.0.6' +release = '3.0.7-dev' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/user_guide_src/source/installation/downloads.rst b/user_guide_src/source/installation/downloads.rst index 979e4c20f..22c63b873 100644 --- a/user_guide_src/source/installation/downloads.rst +++ b/user_guide_src/source/installation/downloads.rst @@ -2,7 +2,8 @@ Downloading CodeIgniter ####################### -- `CodeIgniter v3.0.6 (Current version) `_ +- `CodeIgniter v3.0.7-dev (Current version) `_ +- `CodeIgniter v3.0.6 `_ - `CodeIgniter v3.0.5 `_ - `CodeIgniter v3.0.4 `_ - `CodeIgniter v3.0.3 `_ diff --git a/user_guide_src/source/installation/upgrade_307.rst b/user_guide_src/source/installation/upgrade_307.rst new file mode 100644 index 000000000..ee957aabf --- /dev/null +++ b/user_guide_src/source/installation/upgrade_307.rst @@ -0,0 +1,14 @@ +############################# +Upgrading from 3.0.6 to 3.0.7 +############################# + +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/* directory. + +.. note:: If you have any custom developed files in these directories, + please make copies of them first. diff --git a/user_guide_src/source/installation/upgrading.rst b/user_guide_src/source/installation/upgrading.rst index 040c72832..5beca6586 100644 --- a/user_guide_src/source/installation/upgrading.rst +++ b/user_guide_src/source/installation/upgrading.rst @@ -8,6 +8,7 @@ upgrading from. .. toctree:: :titlesonly: + Upgrading from 3.0.6 to 3.0.7 Upgrading from 3.0.5 to 3.0.6 Upgrading from 3.0.4 to 3.0.5 Upgrading from 3.0.3 to 3.0.4 -- cgit v1.2.3-24-g4f1b