• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug in URI Class since 2.0.1


I've found a bug in the URI-Class since 2.0.1. Im using a subfolder in controllers for my backoffice-controllers, rewriting all requests from backoffice.domain.tld to /backoffice/$1 using:

RewriteCond %{HTTP_HOST} ^backoffice\.domain\.tld
RewriteCond %{REQUEST_URI} !^/backoffice
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) /backoffice/$1 [L]

However since 2.0.1 this will not load the /backoffice/default_controller-controller, it will instead load the root default_controller. When i debugged the code i found out that $uri is empty for my request to backoffice.domain.tld and if it was kept empty it worked, but not if a second trailing slash was added like the way in 2.0.1 and 2.0.2:

if ($uri == '/' || empty($uri))
  return '/';

This fixes the problem:

if ($uri == '/')
  return '/';
if (empty($uri))
  return '';

The second trailing slash might not be working because of my setup (Apache2.2.17 on OSX) but still, if anyone have the same problem this fix works.

You should add the bug to bitbucket if you havent already.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.