mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-25 04:29:16 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9c701aabee | |||
| af2be14ccb | |||
| 2b0821a557 | |||
| fae2e84c98 |
@@ -28,7 +28,7 @@ class InputFile implements IInputItem
|
||||
*/
|
||||
public static function createFromArray(array $values)
|
||||
{
|
||||
if (isset('index', $values) === false) {
|
||||
if (isset($values['index']) === false) {
|
||||
throw new \InvalidArgumentException('Index key is required');
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,15 @@ class Uri
|
||||
*/
|
||||
public function parseUrl($url, $component = -1)
|
||||
{
|
||||
$parts = parse_url(urlencode($url), $component);
|
||||
$encodedUrl = preg_replace_callback(
|
||||
'%[^:/@?&=#]+%u',
|
||||
function ($matches) {
|
||||
return urlencode($matches[0]);
|
||||
},
|
||||
$url
|
||||
);
|
||||
|
||||
$parts = parse_url($encodedUrl, $component);
|
||||
|
||||
if ($parts === false) {
|
||||
throw new \InvalidArgumentException('Malformed URL: ' . $url);
|
||||
|
||||
Reference in New Issue
Block a user