mirror of
https://github.com/bdnugget/php-src.git
synced 2026-11-07 17:27:30 +00:00
Bug #6016: Fix EBCDIC logic error in urlencode()
(a strchr() test was used backwards) Reported by: dumbunny@tivo.com
This commit is contained in:
1 parent
e31a7fcdfc
commit
8bf2339870
1 file changed
+2
-1
+2
-1
@@ -253,7 +253,8 @@ char *php_url_encode(char *s, int len)
|
||||
str[y] = hexchars[(unsigned char) s[x] & 15];
|
||||
}
|
||||
#else /*CHARSET_EBCDIC*/
|
||||
} else if (!isalnum(str[y]) && strchr("_-.", str[y]) != NULL) {
|
||||
} else if (!isalnum(str[y]) && strchr("_-.", str[y]) == NULL) {
|
||||
/* Allow only alphanumeric chars and '_', '-', '.'; escape the rest */
|
||||
str[y++] = '%';
|
||||
str[y++] = hexchars[os_toascii[(unsigned char) s[x]] >> 4];
|
||||
str[y] = hexchars[os_toascii[(unsigned char) s[x]] & 0x0F];
|
||||
|
||||
Reference in new issue
Block a user