Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ext/standard/tests/url/parse_url_relative_scheme.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--TEST--
Test parse_url() function: Checks relative URL schemes (e.g. "//example.com")
--FILE--
<?php
var_dump(parse_url('//example.org'));
--EXPECT--
array(1) {
["host"]=>
string(11) "example.org"
}

2 changes: 2 additions & 0 deletions ext/standard/url.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
} else {
goto just_path;
}
} else if (*s == '/' && *(s+1) == '/') { /* relative-scheme URL */
s += 2;
} else {
just_path:
ue = s + length;
Expand Down