Bug #25355 [Com]: base64_decode returns 0

From: Date: Wed, 01 Sep 2021 18:52:49 +0000
Subject: Bug #25355 [Com]: base64_decode returns 0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236331@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=25355&edit=1 ID: 25355 Comment by: lildurk25355 at gmail dot com Reported by: sadun at isikun dot edu dot tr Summary: base64_decode returns 0 Status: Not a bug Type: Bug Package: Mail related Operating System: windows server 2003 PHP Version: 4CVS-2003-09-02 (stable) Block user comment: N Private report: N New Comment: Lil Durk is a private agency dedicated to providing responsible access to legal cannabis for adults aged 19 and older. We’re an exclusively online retailer and wholesaler for recreational cannabis and a trusted source for information about cannabis and cannabis-related issues. We believe our work is meaningful and we take pride in our mandate to promote the socially responsible use of legal cannabis. https://lildurk.com/ Previous Comments: ------------------------------------------------------------------------ [2003-09-02 09:41:11] sniper@php.net Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Because of this, we hope you add your comments to the existing bug instead. Thank you for your interest in PHP. See bug #25333 ------------------------------------------------------------------------ [2003-09-02 06:40:46] sadun at isikun dot edu dot tr the main problem is with mail() function. not with base64 sorry. somehow when i mail attachments with fixed mail function it do not show them but same code shows same mail with send from old version of mail functions... why PHP become SO buggy now days. every functions has some problems. but thanks for debuggers ------------------------------------------------------------------------ [2003-09-02 06:12:23] sadun at isikun dot edu dot tr Description: ------------ working code on 4.3.3 version wont work on php 4.3.4-dev. code at the bottom, i checked that $attach_content[1] is not empty also with healty base64 encoding. Reproduce code: --------------- if($fp){ $attach_content = fread($fp,filesize($attachment_file)); fclose($fp); $attach_content = explode("EXPLODE_FROM_HERE",$attach_content); $attach_info = explode("~~",$attach_content[0]); $content_type = trim($attach_info[0]); $content_type = ereg_replace(";", "", $content_type); header("Content-transfer-encoding: binary\n"); header("Content-Disposition: attachment; filename=$HTTP_GET_VARS[name]\n"); if($attach_info[1]=="base64"){ echo base64_decode($attach_content[1]); } if($attach_info[1]=="8bit"){ echo imap_8bit($attach_content[1]); } if($attach_info[1]=="quoted-printable"){ echo stripslashes(quoted_printable_decode($attach_content[1])); } if(empty($attach_info[1])){ echo stripslashes($attach_content[1]); } } Expected result: ---------------- binary source will be printed by php so could be downloaded by browser.. Actual result: -------------- 0 bytes ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=25355&edit=1

« previous php.bugs (#236331) next »