Skip to content

Commit

Permalink
Merge pull request #1 from slimphp/3.x
Browse files Browse the repository at this point in the history
pull
  • Loading branch information
geggleto committed Dec 17, 2015
2 parents 01187ee + e88c825 commit 4234d77
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Enforce Unix newlines
* text=lf

# Exclude unused files
# see: https://redd.it/2jzp6k
/tests export-ignore
/.codeclimate.yml export-ignore
/.coveralls.yml export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
6 changes: 5 additions & 1 deletion Slim/Http/Uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ public static function createFromEnvironment(Environment $env)
// Path
$requestScriptName = parse_url($env->get('SCRIPT_NAME'), PHP_URL_PATH);
$requestScriptDir = dirname($requestScriptName);
$requestUri = parse_url($env->get('REQUEST_URI'), PHP_URL_PATH);

// parse_url() requires a full URL. As we don't extract the domain name or scheme,
// we use a stand-in.
$requestUri = parse_url('http://example.com' . $env->get('REQUEST_URI'), PHP_URL_PATH);

$basePath = '';
$virtualPath = $requestUri;
if (stripos($requestUri, $requestScriptName) === 0) {
Expand Down

0 comments on commit 4234d77

Please sign in to comment.