Skip to content

Commit

Permalink
Test querystring is ignored in URI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Aug 4, 2014
1 parent 3015f74 commit fd7e693
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/Request/Standardiser.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ class Standardiser {
*/
public function fixUri($uri, ConfigObj $config) {
$queryString = parse_url($uri, PHP_URL_QUERY);
$fixed = $uri;
$fixed = strtok($uri, "?");

$pathinfo = pathinfo($fixed);
$file = strtok($pathinfo["filename"], "?");
$file = $pathinfo["filename"];
$ext = empty($pathinfo["extension"])
? null
: strtok($pathinfo["extension"], "?");
: $pathinfo["extension"];

$fixed = $this->fixHtmlExtension($fixed, $file, $ext, $config);
$fixed = $this->fixIndexFilename($fixed, $file, $ext, $config);
Expand Down
3 changes: 2 additions & 1 deletion test/Unit/Request/Standardiser.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ public function testQueryStringPreserved($uri) {
*/
public function testFixUri($uri) {
$standardiser = new Standardiser();
$fixed = $standardiser->fixUri($uri, new ConfigObj());

$fixed = $standardiser->fixUri("$uri", new ConfigObj() );
$this->assertInternalType("string", $fixed);
}

Expand Down

0 comments on commit fd7e693

Please sign in to comment.