Permalink
Browse files

Remove query string from request uri when determining route from requ…

…est uri
  • Loading branch information...
1 parent 12955a3 commit 8a02a86f57fc662eacd3d3d68af325cf4ed46583 @sloonz sloonz committed Mar 14, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/limonade.php
View
@@ -1058,14 +1058,17 @@ function request_uri($env = null)
}
elseif(array_key_exists('REQUEST_URI', $env['SERVER']) && !empty($env['SERVER']['REQUEST_URI']))
{
- $request_uri = rtrim(rawurldecode($env['SERVER']['REQUEST_URI']), '?/').'/';
+ $request_uri = rtrim($env['SERVER']['REQUEST_URI'], '?/').'/';
$base_path = $env['SERVER']['SCRIPT_NAME'];
if($request_uri."index.php" == $base_path) $request_uri .= "index.php";
$uri = str_replace($base_path, '', $request_uri);
if(option('base_uri') && strpos($uri, option('base_uri')) === 0) {
$uri = substr($uri, strlen(option('base_uri')));
}
+ if(strpos($uri, '?') !== false) {
+ $uri = substr($uri, 0, strpos($uri, '?')) . '/';
+ }
}
elseif($env['SERVER']['argc'] > 1 && trim($env['SERVER']['argv'][1], '/') != '')
{

0 comments on commit 8a02a86

Please sign in to comment.