Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

…est uri
  • Loading branch information...
commit 8a02a86f57fc662eacd3d3d68af325cf4ed46583 1 parent 12955a3
@sloonz sloonz authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 lib/limonade.php
View
5 lib/limonade.php
@@ -1058,7 +1058,7 @@ 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";
@@ -1066,6 +1066,9 @@ function request_uri($env = null)
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], '/') != '')
{
Please sign in to comment.
Something went wrong with that request. Please try again.