#36106 [NEW]: Output of base64_decode differs between 5.0.4 and 5.1.2

From: Date: Fri, 20 Jan 2006 16:27:48 +0000
Subject: #36106 [NEW]: Output of base64_decode differs between 5.0.4 and 5.1.2
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-92301@lists.php.net to get a copy of this message
From:             schapht at verizon dot net
Operating system: CentOS 4.1
PHP version:      5.1.2
PHP Bug Type:     URL related
Bug description:  Output of base64_decode differs between 5.0.4 and 5.1.2

Description:
------------
The decoding behavior of base64_decode seems to have changed between 5.0.4
and 5.1.2.

A simple case like 'SGVsbG8gV29ybGQh' (Hello World!) works, bu this more
complex case (an already encrypted string) breaks.

NOTE: The reason I'm feeding the $complexString output into md5 is that is
contains many unprintable characters because the base64_encrypted string is
an already blowfish-encrypted string.

Reproduce code:
---------------
<?php

$string = "B 5mvYwuEVli6vkhSUH9dRwpxUWe6LdXQOV8PTak0nlftEZ8lMwnib7 Z
SJQt5gXtf1FirG3p8ryIM6JBVVBRH9ceS5jXkCvi4Y4X8HAAIWyujb1WHOpDIItQ1ixLul1ylezCkBZC5iGDlH/IchuPUMtvnoP9FeOy5CwQ==";
echo md5(base64_decode($string));
echo "\n";
?>

Expected result:
----------------
[schapht@dev ~]$ /usr/local/src/php-5.1.2/sapi/cli/php test.php
Easy    : Hello World!
Complex (fed through md5): 10a36e3377f55d981af2b547971ff3da
[schapht@dev ~]$ /usr/local/src/php-5.0.4/sapi/cli/php test.php
Easy    : Hello World!
Complex (fed through md5): 10a36e3377f55d981af2b547971ff3da

Actual result:
--------------
[schapht@dev ~]$ /usr/local/src/php-5.1.2/sapi/cli/php test.php
Easy    : Hello World!
Complex (fed through md5): 52054f13d2bc7b82cd55bcb37c02b32b
[schapht@dev ~]$ /usr/local/src/php-5.0.4/sapi/cli/php test.php
Easy    : Hello World!
Complex (fed through md5): 10a36e3377f55d981af2b547971ff3da

-- 
Edit bug report at http://bugs.php.net/?id=36106&edit=1
-- 
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36106&r=trysnapshot44
Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36106&r=trysnapshot51
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36106&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=36106&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=36106&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=36106&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=36106&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=36106&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=36106&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=36106&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=36106&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=36106&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=36106&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=36106&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=36106&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=36106&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=36106&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=36106&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=36106&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=36106&r=mysqlcfg


Thread (4 messages)

« previous php.bugs (#92301) next »