cvs: php4 /ext/standard url.c
| From: | Martin Kraemer | Date: | Tue, 08 Aug 2000 09:06:51 +0000 |
| Subject: | cvs: php4 /ext/standard url.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1098@lists.php.net to get a copy of this message | ||
martin Tue Aug 8 02:06:51 2000 EDT
Modified files:
/php4/ext/standard url.c
Log:
Bug #6016: Fix EBCDIC logic error in urlencode()
(a strchr() test was used backwards)
Reported by: dumbunny@tivo.com
Index: php4/ext/standard/url.c
diff -u php4/ext/standard/url.c:1.27 php4/ext/standard/url.c:1.28
--- php4/ext/standard/url.c:1.27 Sat Jul 29 15:32:21 2000
+++ php4/ext/standard/url.c Tue Aug 8 02:06:51 2000
@@ -15,7 +15,7 @@
| Author: Jim Winstead (jimw@php.net) |
+----------------------------------------------------------------------+
*/
-/* $Id: url.c,v 1.27 2000/07/29 22:32:21 rasmus Exp $ */
+/* $Id: url.c,v 1.28 2000/08/08 09:06:51 martin Exp $ */
#include <stdlib.h>
#include <string.h>
@@ -253,7 +253,8 @@
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];