Merge pull request #322 from skipperbent/v3

V3
This commit is contained in:
Simon Sessingø
2017-11-26 18:46:25 +01:00
committed by GitHub
2 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ class InputFile implements IInputItem
*/ */
public static function createFromArray(array $values) public static function createFromArray(array $values)
{ {
if (isset('index', $values) === false) { if (isset($values['index']) === false) {
throw new \InvalidArgumentException('Index key is required'); throw new \InvalidArgumentException('Index key is required');
} }
+9 -1
View File
@@ -134,7 +134,15 @@ class Uri
*/ */
public function parseUrl($url, $component = -1) 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) { if ($parts === false) {
throw new \InvalidArgumentException('Malformed URL: ' . $url); throw new \InvalidArgumentException('Malformed URL: ' . $url);