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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 12:01:35 2025 UTC