Skip to content

Commit eaf5808

Browse files
committed
fixed urls with :largue #212
1 parent adee7f6 commit eaf5808

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/Http/Url.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public function getPath()
305305
$path = !empty($this->info['path']) ? '/'.implode('/', array_map('urlencode', $this->info['path'])).'/' : '/';
306306

307307
if (isset($this->info['file'])) {
308-
$path .= urlencode($this->info['file']);
308+
$path .= self::urlEncode($this->info['file']);
309309

310310
if (isset($this->info['extension'])) {
311311
$path .= '.'.$this->info['extension'];
@@ -649,4 +649,9 @@ function ($matches) {
649649

650650
return $parts;
651651
}
652+
653+
private static function urlEncode($path)
654+
{
655+
return str_replace(['%3A'], [':'], urlencode($path));
656+
}
652657
}

tests/UrlTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public function urlsParserProvider()
2424
['http://testuser:testpass@test.drupal.dd:8083/tests/authenticated.html', 'http://testuser:testpass@test.drupal.dd:8083/tests/authenticated.html'],
2525
['http://testuser:testpass@test.drupal.dd:8083/tests/authenticated.html', 'http://testuser:testpass@test.drupal.dd:8083/tests/authenticated.html'],
2626
['http://www.innherred.no/kultur/2017/03/25/On-the-road-med-%C3%86-og-Hagen-14499028.ece', 'http://www.innherred.no/kultur/2017/03/25/On-the-road-med-%C3%86-og-Hagen-14499028.ece'],
27+
['https://pbs.twimg.com/media/CvCZ90BXYAE5q80.png:large', 'https://pbs.twimg.com/media/CvCZ90BXYAE5q80.png:large'],
2728
];
2829
}
2930

0 commit comments

Comments
 (0)