|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2019-03-18 14:03 UTC] juanparati at gmail dot com
Description:
------------
I found that "parse_url" function doesn't retrieve the scheme when more than one semicolon is used and url doesn't contain the hostname separator.
Test script:
---------------
// It works correctly with this case
echo parse_url('http://user:pass@example.net', PHP_URL_SCHEME) === 'http' ? 'http' : 'no scheme';
// It doesn't work correctly for the following case
echo parse_url('git://git@example.net:myorg/my-repo.git', PHP_URL_SCHEME) === 'http' ? 'GIT' : 'no scheme';
Expected result:
----------------
The expected result is to resolve the scheme as "git" for git urls like:
"git://git@example.net:myorg/my-repo.git"
Actual result:
--------------
"false" is receive
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 22 16:00:01 2025 UTC |
Description: ------------ I found that "parse_url" function doesn't retrieve the scheme with "git" style urls. Test script: --------------- // It works correctly with this case echo parse_url('http://user:pass@example.net', PHP_URL_SCHEME) === 'http' ? 'http' : 'no scheme'; // It doesn't work correctly for the following case echo parse_url('git://git@example.net:myorg/my-repo.git', PHP_URL_SCHEME) === 'git' ? 'git' : 'no scheme'; Expected result: ---------------- The expected result is to resolve the scheme as "git" for git urls like: "git://git@example.net:myorg/my-repo.git" Actual result: -------------- "false" is receive