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

#1
[eluser]Unknown[/eluser]
Hi,

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:

Code:
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:

Code:
if ($uri == '/' || empty($uri))
{
  return '/';
}

This fixes the problem:

Code:
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.


Messages In This Thread
Bug in URI Class since 2.0.1 - by El Forum - 07-08-2011, 06:17 AM
Bug in URI Class since 2.0.1 - by El Forum - 07-08-2011, 02:47 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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