[eluser]pistolPete[/eluser]
Your regular expression is correct.
The reason why CodeIgniter accepts the double slashes is because apache (which you are probably using) "converts" double slashes to single slashes.
Assuming that you've set
Code:
$config['uri_protocol'] = "AUTO";
or
Code:
$config['uri_protocol'] = "QUERY_STRING";
CodeIgniter uses the
QUERY_STRING environment variable.
Have a look at
Code:
function _fetch_uri_string()
in
./system/libraries/URI.php
But even if you set
Code:
$config['uri_protocol'] = "REQUEST_URI";
which is unaltered by apache, the multipe slashes are "removed" by
Code:
function _explode_segments()
in
./system/libraries/URI.php
Conclusion:
If you want to filter out bad requests containing double slashes, you better add the following lines to your
.htaccess file:
Code:
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]