|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-04-02 10:49 UTC] kirlo at gmx dot de
Description: ------------ we're encoding some text data with base64 with a small application (not php) on a client pc, then we'll send it to a webserver via POST or GET. the PHP script is fetching POST or GET without any problems but it does not correctly perform the base64_decode operation. we checked our base64 encoded text with other tools (for example http://makcoder.sourceforge.net/demo/base64.php ) and they had no problems! this system works with the latest php4 version but it does not work with the latest php5 version (on the earlier version it also worked well!). i already tried the latest CVS snapshot but it didn't worked either. Reproduce code: --------------- very simple: echo base64_decode($_POST[base64text]); Expected result: ---------------- here are three files the original text: http://t-man.isr-clan.ath.cx/phpbugreport/original.txt the base64 encoded text (base64 encoding performed by our client application): http://t-man.isr-clan.ath.cx/phpbugreport/base64encoded.txt the base64_decode output: http://t-man.isr-clan.ath.cx/phpbugreport/base64_decode-output.txt in this case the messed up text is at the end of the text. sometimes the messed up text is starting at the first 2 or 3 lines. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 11:00:02 2025 UTC |
well that's mysterious - this script will work without any problems (put my base64encoded.txt into the scriptdir): <?php $fp = fopen ("base64encoded.txt", "r"); $str = fread ($fp, filesize ("base64encoded.txt")); fclose ($fp); echo base64_decode($str); ?> but if you send the string via POST or GET, you'll get this output, where the text ist messed up (copy the content of base64encoded.txt and put it behind yourscript.php?vari= ): <?php echo base64_decode($_GET[vari]); ?>