PHP 4.0 Bug #6016: url.c's php_url_encode is wrong there
| From: | dumbunny at tivo dot com | Date: | Tue, 08 Aug 2000 04:32:28 +0000 |
| Subject: | PHP 4.0 Bug #6016: url.c's php_url_encode is wrong there | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-28058@lists.php.net to get a copy of this message | ||
From: dumbunny@tivo.com
Operating system: -DCHARSET_EBCDIC
PHP version: 4.0.1pl2
PHP Bug Type: Misbehaving function
Bug description: url.c's php_url_encode is wrong there
It looks like line 256's strchr("_-.", str[y]) != NULL) is
backwards. You want to execute the conditional if str[y] is
not one of "_-.", in which case strchr() returns NULL.
url.c:255-260 are:
#else /*CHARSET_EBCDIC*/
} else if (!isalnum(str[y]) && strchr("_-.", str[y]) != NULL) {
str[y++] = '%';
str[y++] = hexchars[os_toascii[(unsigned char) s[x]] >> 4];
str[y] = hexchars[os_toascii[(unsigned char) s[x]] & 0x0F];
}
#endif /*CHARSET_EBCDIC*/