diff options
Diffstat (limited to 'ext/standard/url.c')
| -rw-r--r-- | ext/standard/url.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c index 63c5f60dd5..4d07d249bb 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -104,6 +104,19 @@ PHPAPI php_url *php_url_parse_ex(char const *str, int length) /* parse scheme */ if ((e = memchr(s, ':', length)) && (e - s)) { + /* validate scheme */ + p = s; + while (p < e) { + if (!isalnum(*p)) { + if (e + 1 < ue) { + goto parse_port; + } else { + goto just_path; + } + } + p++; + } + if (*(e + 1) == '\0') { /* only scheme is available */ ret->scheme = estrndup(s, (e - s)); php_replace_controlchars_ex(ret->scheme, (e - s)); |
