From 7676c2d6761cb3cdeccf005c2a30140f0ba3ced5 Mon Sep 17 00:00:00 2001 From: Andrey Andreev Date: Tue, 30 Oct 2012 13:42:01 +0200 Subject: Fix issue #658 (:any wildcard matching slashes) --- user_guide_src/source/installation/upgrade_300.rst | 40 +++++++++++++++++----- 1 file changed, 31 insertions(+), 9 deletions(-) (limited to 'user_guide_src/source/installation') diff --git a/user_guide_src/source/installation/upgrade_300.rst b/user_guide_src/source/installation/upgrade_300.rst index dcdd6e351..6d99f4655 100644 --- a/user_guide_src/source/installation/upgrade_300.rst +++ b/user_guide_src/source/installation/upgrade_300.rst @@ -52,11 +52,12 @@ Step 5: Update your config/database.php *************************************** Due to 3.0.0's renaming of Active Record to Query Builder, inside your `config/database.php`, you will -need to rename the `$active_record` variable to `$query_builder`. +need to rename the `$active_record` variable to `$query_builder` +:: - $active_group = 'default'; - // $active_record = TRUE; - $query_builder = TRUE; + $active_group = 'default'; + // $active_record = TRUE; + $query_builder = TRUE; ******************************* Step 6: Move your errors folder @@ -64,15 +65,36 @@ Step 6: Move your errors folder In version 3.0.0, the errors folder has been moved from _application/errors* to _application/views/errors*. +******************************************************* +Step 7: Update your config/routes.php containing (:any) +******************************************************* + +Historically, CodeIgniter has always provided the **:any** wildcard in routing, +with the intention of providing a way to match any character **within** an URI segment. + +However, the **:any** wildcard is actually just an alias for a regular expression +and used to be executed in that manner as **.+**. This is considered a bug, as it +also matches the / (forward slash) character, which is the URI segment delimiter +and that was never the intention. In CodeIgniter 3, the **:any** wildcard will now +represent **[^/]+**, so that it will not match a forward slash. + +There are certainly many developers that have utilized this bug as an actual feature. +If you're one of them and want to match a forward slash, please use the **.+** +regular expression:: + + (.+) // matches ANYTHING + (:any) // matches any character, except for '/' + + **************************************************************************** -Step 7: Check the calls to Array Helper's element() and elements() functions +Step 8: Check the calls to Array Helper's element() and elements() functions **************************************************************************** The default return value of these functions, when the required elements don't exist, has been changed from FALSE to NULL. ********************************************************** -Step 8: Change usage of Email library with multiple emails +Step 9: Change usage of Email library with multiple emails ********************************************************** The :doc:`Email library <../libraries/email>` will automatically clear the @@ -87,9 +109,9 @@ pass FALSE as the first parameter in the ``send()`` method: } -*************************************************************** -Step 9: Remove usage of (previously) deprecated functionalities -*************************************************************** +**************************************************************** +Step 10: Remove usage of (previously) deprecated functionalities +**************************************************************** In addition to the ``$autoload['core']`` configuration setting, there's a number of other functionalities that have been removed in CodeIgniter 3.0.0: -- cgit v1.2.3-24-g4f1b