diff options
| author | Lars Strojny <lstrojny@php.net> | 2008-08-20 20:35:40 +0000 |
|---|---|---|
| committer | Lars Strojny <lstrojny@php.net> | 2008-08-20 20:35:40 +0000 |
| commit | 080157870f7791614b1d9c36851088aff82b2ca0 (patch) | |
| tree | e699e395fcb5de197fe8a638cd198a54c4d624ce /ext/standard/url.c | |
| parent | 6b2be7c7e96beb58de6d59e74055d2046b433815 (diff) | |
| download | php-git-080157870f7791614b1d9c36851088aff82b2ca0.tar.gz | |
MFH: Allow mixed $initial (patch by Christian Seiler)
Diffstat (limited to 'ext/standard/url.c')
| -rw-r--r-- | ext/standard/url.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ext/standard/url.c b/ext/standard/url.c index 9dc8a2fe8b..7d354d4c80 100644 --- a/ext/standard/url.c +++ b/ext/standard/url.c @@ -65,21 +65,23 @@ PHPAPI char *php_replace_controlchars_ex(char *str, int len) { unsigned char *s = (unsigned char *)str; unsigned char *e = (unsigned char *)str + len; - + unsigned char *r[len + 1]; + unsigned int c = 0; + if (!str) { - return (NULL); + return NULL; } - + while (s < e) { - - if (iscntrl(*s)) { - *s='_'; - } + if (0 == iscntrl(*s)) { + r[c] = *s; + c++; + } s++; } - - return (str); -} + + return (unsigned char *)r; +} /* }}} */ PHPAPI char *php_replace_controlchars(char *str) |
