cvs: php3 /functions url.c

From: Date: Fri, 04 Aug 2000 12:28:41 +0000
Subject: cvs: php3 /functions url.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1032@lists.php.net to get a copy of this message
martin Fri Aug 4 05:28:41 2000 EDT Modified files: /php3/functions url.c Log: Fix EBCDIC logic error in urlencode() Index: php3/functions/url.c diff -u php3/functions/url.c:1.45 php3/functions/url.c:1.46 --- php3/functions/url.c:1.45 Fri Dec 31 20:31:17 1999 +++ php3/functions/url.c Fri Aug 4 05:28:41 2000 @@ -26,7 +26,7 @@ | Author: Jim Winstead (jimw@php.net) | +----------------------------------------------------------------------+ */ -/* $Id: url.c,v 1.45 2000/01/01 04:31:17 sas Exp $ */ +/* $Id: url.c,v 1.46 2000/08/04 12:28:41 martin Exp $ */ #include <stdlib.h> #include <string.h> @@ -254,7 +254,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];

« previous php.cvs (#1032) next »