php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35116 base64_decode broken in PHP 4.4.1
Submitted: 2005-11-05 19:28 UTC Modified: 2005-11-05 20:53 UTC
From: mj@php.net Assigned:
Status: Not a bug Package: Strings related
PHP Version: 4.4.1 OS: Linux
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: mj@php.net
New email:
PHP Version: OS:

 

 [2005-11-05 19:28 UTC] mj@php.net
Description:
------------
While base64_decode works properly in PHP 4.4.0 and PHP 5, it fails in PHP 4.4.1.  I can reproduce this problem with vanilla sources of PHP 4.4.1 with the following ./configure line:

./configure --disable-all --with-mcrypt --enable-cli

I'm using Linux with glibc 2.3.5 and GCC 4.0.3.

Reproduce code:
---------------
<?php
echo base64_decode("Hello World");

Expected result:
----------------
?e?娮W

Actual result:
--------------
?e?j+

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-05 20:00 UTC] mj@php.net
I understand that whitespaces are not supported in Base64, but still the behaviour of base64_decode() should not change from 4.4.0 to 4.4.1.
 [2005-11-05 20:01 UTC] sniper@php.net
Why can't a bug be fixed?
 [2005-11-05 20:04 UTC] mj@php.net
I'm not questioning that a bug shouldn't be fixed.  What I'm questioning is if this should happen within minor releases *if* the fix imposes a BC break.
 [2005-11-05 20:53 UTC] mj@php.net
Thinking about it again, I don't consider the change a BC break anymore.  Clearly PHP's implementation of Base64 was incorrect prior to fixing #34214 and thus people like me, who passed input containing whitespace to base64_decode(), were doing something wrong in first place.

Still it was surprising to see an application stop working when deploying a security release of PHP, but such is live I guess.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 09:01:29 2024 UTC