Fix secure-http check to avoid bypass using emojis
parent
b93fc6ca43
commit
7a1e02d1a3
|
@ -587,8 +587,8 @@ class Config
|
||||||
*/
|
*/
|
||||||
public function prohibitUrlByConfig($url, IOInterface $io = null)
|
public function prohibitUrlByConfig($url, IOInterface $io = null)
|
||||||
{
|
{
|
||||||
// Return right away if the URL is malformed or custom (see issue #5173)
|
// Return right away if the URL is malformed or custom (see issue #5173), but only for non-HTTP(S) URLs
|
||||||
if (false === filter_var($url, FILTER_VALIDATE_URL)) {
|
if (false === filter_var($url, FILTER_VALIDATE_URL) && !Preg::isMatch('{^https?://}', $url)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -298,6 +298,7 @@ class ConfigTest extends TestCase
|
||||||
'http://packagist.org',
|
'http://packagist.org',
|
||||||
'http://10.1.0.1/satis',
|
'http://10.1.0.1/satis',
|
||||||
'http://127.0.0.1/satis',
|
'http://127.0.0.1/satis',
|
||||||
|
'http://💛@example.org',
|
||||||
'svn://localhost/trunk',
|
'svn://localhost/trunk',
|
||||||
'svn://will.not.resolve/trunk',
|
'svn://will.not.resolve/trunk',
|
||||||
'svn://192.168.0.1/trunk',
|
'svn://192.168.0.1/trunk',
|
||||||
|
|
Loading…
Reference in New Issue