Bug #65947 [Asn->Csd]: basename is no more working after fgetcsv in certain situation
| From: | laruence@php.net | Date: | Fri, 08 Nov 2013 07:35:14 +0000 |
| Subject: | Bug #65947 [Asn->Csd]: basename is no more working after fgetcsv in certain situation | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-182651@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
Updated by: laruence@php.net
Reported by: phpbugs at dev dot bitadept dot org
Summary: basename is no more working after fgetcsv in certain
situation
-Status: Assigned
+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:
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)
Previous Comments:
------------------------------------------------------------------------
[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
------------------------------------------------------------------------
[2013-11-05 15:24:05] phpbugs at dev dot bitadept dot org
Applied patch to php-5.5.5-pl0-gentoo and works fine now.
------------------------------------------------------------------------
[2013-11-05 14:31:40] remi dot sauvat+php at gmail dot com
The patch is working for me. It fixes the basename and pathinfo php functions. Patch applied to PHP
5.5.4-pl0-gentoo
------------------------------------------------------------------------
[2013-11-05 13:41:59] laruence@php.net
a patch is attached to explain where the problems come from.
anyway maybe a better fix is clean the stat in getcsv.
------------------------------------------------------------------------
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