Skip to content

Commit d320368

Browse files
authored
Removed php_replace_controlchars
1 parent 4cc7c77 commit d320368

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

ext/standard/url.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,6 @@ PHPAPI void php_url_free(php_url *theurl)
4747
}
4848
/* }}} */
4949

50-
static void php_str_to_utf8(zend_string *str)
51-
{
52-
const unsigned char *s = (const unsigned char *)ZSTR_VAL(str);
53-
const unsigned char *e = s + ZSTR_LEN(str);
54-
while (s < e) {
55-
if (*s & 0x80) {
56-
return;
57-
}
58-
s++;
59-
}
60-
}
6150

6251
PHPAPI php_url *php_url_parse(char const *str)
6352
{
@@ -116,7 +105,6 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port
116105

117106
if (e + 1 == ue) { /* only scheme is available */
118107
ret->scheme = zend_string_init(s, (e - s), 0);
119-
php_str_to_utf8(ret->scheme);
120108
return ret;
121109
}
122110

@@ -138,13 +126,11 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port
138126
}
139127

140128
ret->scheme = zend_string_init(s, (e-s), 0);
141-
php_str_to_utf8(ret->scheme);
142129

143130
s = e + 1;
144131
goto just_path;
145132
} else {
146133
ret->scheme = zend_string_init(s, (e-s), 0);
147-
php_str_to_utf8(ret->scheme);
148134

149135
if (e + 2 < ue && *(e + 2) == '/') {
150136
s = e + 3;
@@ -210,14 +196,11 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port
210196
if ((p = zend_memrchr(s, '@', (e-s)))) {
211197
if ((pp = memchr(s, ':', (p-s)))) {
212198
ret->user = zend_string_init(s, (pp-s), 0);
213-
php_str_to_utf8(ret->user);
214199

215200
pp++;
216201
ret->pass = zend_string_init(pp, (p-pp), 0);
217-
php_str_to_utf8(ret->pass);
218202
} else {
219203
ret->user = zend_string_init(s, (p-s), 0);
220-
php_str_to_utf8(ret->user);
221204
}
222205

223206
s = p + 1;
@@ -266,7 +249,6 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port
266249
}
267250

268251
ret->host = zend_string_init(s, (p-s), 0);
269-
php_str_to_utf8(ret->host);
270252

271253
if (e == ue) {
272254
return ret;
@@ -282,7 +264,6 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port
282264
p++;
283265
if (p < e) {
284266
ret->fragment = zend_string_init(p, (e - p), 0);
285-
php_str_to_utf8(ret->fragment);
286267
} else {
287268
ret->fragment = ZSTR_EMPTY_ALLOC();
288269
}
@@ -294,7 +275,6 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port
294275
p++;
295276
if (p < e) {
296277
ret->query = zend_string_init(p, (e - p), 0);
297-
php_str_to_utf8(ret->query);
298278
} else {
299279
ret->query = ZSTR_EMPTY_ALLOC();
300280
}
@@ -303,7 +283,6 @@ PHPAPI php_url *php_url_parse_ex2(char const *str, size_t length, bool *has_port
303283

304284
if (s < e || s == ue) {
305285
ret->path = zend_string_init(s, (e - s), 0);
306-
php_str_to_utf8(ret->path);
307286
}
308287

309288
return ret;

0 commit comments

Comments
 (0)