Changeset 1850

Show
Ignore:
Timestamp:
01/28/2008 02:56:44 PM (12 months ago)
Author:
Geert
Message:

Router->filter_uri() regex optimization:

  • Made + possessive: this regex should never ever do any useless backtracking.
  • Added D modifier: this regex should never ever allow final linebreaks.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/system/libraries/Router.php

    r1795 r1850  
    271271                if ($str != '' AND ($allowed = Config::item('routes._allowed')) != '') 
    272272                { 
    273                         if ( ! preg_match('|^['.preg_quote($allowed).']+$|iu', $str)) 
     273                        if ( ! preg_match('|^['.preg_quote($allowed).']++$|iuD', $str)) 
    274274                        { 
    275275                                header('HTTP/1.1 400 Bad Request');