Skip to content

Commit 563c85a

Browse files
committed
RequestFactory: invalid byte sequences in path are not silently discarded
1 parent 88784b1 commit 563c85a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Http/RequestFactory.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ public function createHttpRequest()
100100

101101
// normalized url
102102
$url->canonicalize();
103-
$url->setPath(Strings::fixEncoding($url->getPath()));
103+
104+
if (preg_match(self::NONCHARS, $url->getPath()) || preg_last_error()) {
105+
throw new InvalidRequestException(); // TODO!
106+
}
104107

105108
// detect script path
106109
if (isset($_SERVER['SCRIPT_NAME'])) {

0 commit comments

Comments
 (0)