php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6016 url.c's php_url_encode is wrong there
Submitted: 2000-08-08 00:32 UTC Modified: 2000-08-08 05:10 UTC
From: dumbunny at tivo dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.1pl2 OS: -DCHARSET_EBCDIC
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dumbunny at tivo dot com
New email:
PHP Version: OS:

 

 [2000-08-08 00:32 UTC] dumbunny at tivo dot com
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*/

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-08 01:20 UTC] rasmus@php.net
This has been forwarded to Mr. EBCDIC himself...  Expect an answer soon.
 [2000-08-08 05:10 UTC] martin@php.net
Thanke for the report. I fixed this bug independently 3 days ago in php-3.0,
but forgot to commit it for php-4
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 11:01:31 2024 UTC