We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0943b79 commit b57e6a4Copy full SHA for b57e6a4
ext/standard/url.c
@@ -104,6 +104,19 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length)
104
105
/* parse scheme */
106
if ((e = memchr(s, ':', length)) && (e - s)) {
107
+ /* validate scheme */
108
+ p = s;
109
+ while (p < e) {
110
+ if (!isalnum(*p)) {
111
+ if (e + 1 < ue) {
112
+ goto parse_port;
113
+ } else {
114
+ goto just_path;
115
+ }
116
117
+ p++;
118
119
+
120
if (*(e + 1) == '\0') { /* only scheme is available */
121
ret->scheme = estrndup(s, (e - s));
122
php_replace_controlchars_ex(ret->scheme, (e - s));
0 commit comments