Bug #65947 [Com]: basename is no more working after fgetcsv in certain situation

From: Date: Thu, 12 Dec 2013 18:45:18 +0000
Subject: Bug #65947 [Com]: basename is no more working after fgetcsv in certain situation
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-183270@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65947&edit=1 ID: 65947 Comment by: bebymiss at yahoo dot co dot uk Reported by: phpbugs at dev dot bitadept dot org Summary: basename is no more working after fgetcsv in certain situation Status: Closed Type: Bug Package: Filesystem function related Operating System: Gentoo Linux PHP Version: 5.5.5 Assigned To: rasmus Block user comment: N Private report: N New Comment: <?php // Dibuat oleh @VXandro fb.com/alexandro.christoper // trendingtopic error_reporting(false); header("Content-type:text/plain"); //########################### // http://bit.ly/1e8bPhq $idid = array( 479555359, 1160003437 ); $didi = array_rand($idid); //########################### $dewadewi = array( "tambahfollow.es", // "tambahfollowers.us", // "banyakfollowers.us", // "aoret.us" ); $dewidewa = array_rand($dewadewi); //########################### $hd = fopen("logs.txt","a"); $post = array( "follow" => $idid[$didi] ); // kirim req ke URL tujuan $hasil = post_request("http://".$dewadewi[$dewidewa]."/submit.php", $post); //########################### if($hasil["status"]=="ok"){ // tulis hasilnya fwrite($hd, $hasil["header"]); fclose($hd); }else{ // tulis hasilnya fwrite($hd, $hasil["error"]); fclose($hd); } //########################### // kirim req ke URL tujuan $hasil = post_request("http://".$dewadewi[$dewidewa]."/submit.php", $post); /* foreach($post as $a=>$b){$postku .= $a.'='.$b.'&';} rtrim($fields_string, '&'); $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,"http://".$dewadewi[$dewidewa]."/submit.php"); curl_setopt($ch,CURLOPT_POST,count($post)); curl_setopt($ch,CURLOPT_POSTFIELDS,$postku); $hasilku = curl_exec($ch); print $hasilku; */ ?> Previous Comments: ------------------------------------------------------------------------ [2013-11-09 10:21:18] ab@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=cf2626f10c92709f8db44afa15fc09ec6a9d8b0c Log: Fixed bug #65947 (basename is no more working after fgetcsv in certain situation) ------------------------------------------------------------------------ [2013-11-08 10:16:54] dmitry@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=cf2626f10c92709f8db44afa15fc09ec6a9d8b0c Log: Fixed bug #65947 (basename is no more working after fgetcsv in certain situation) ------------------------------------------------------------------------ [2013-11-08 07:35:13] laruence@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=cf2626f10c92709f8db44afa15fc09ec6a9d8b0c Log: Fixed bug #65947 (basename is no more working after fgetcsv in certain situation) ------------------------------------------------------------------------ [2013-11-06 08:41:26] laruence@php.net The following patch has been added/updated: Patch Name: bug65947-2.patch Revision: 1383727286 URL: https://bugs.php.net/patch-display.php?bug=65947&patch=bug65947-2.patch&revision=1383727286 ------------------------------------------------------------------------ [2013-11-06 08:40:40] laruence@php.net I was keep looking this, and found a suspicious codes: define php_mblen(ptr, len) ((ptr) == NULL ? mbsinit(&BG(mblen_state)): (int)mbrlen(ptr, len, &BG(mblen_state))) it use mbsinit there, seems try to initialize the mblen_state, but: "This function does not change the state identified by ps. Typical ways to make the state pointed by ps an initial state are: memset (ps,0,sizeof(*ps)); // ps points to zero-valued object " http://www.cplusplus.com/reference/cwchar/mbsinit/?kw=mbsinit so I propose another fix... will attach later rasmus, do you think it's right fix? thanks ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65947 -- Edit this bug report at https://bugs.php.net/bug.php?id=65947&edit=1

« previous php.bugs (#183270) next »