php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52931 strripos not overloaded with function overloading enabled
Submitted: 2010-09-27 10:08 UTC Modified: 2010-09-28 01:09 UTC
From: mail at lutz-petzoldt dot de Assigned: felipe (profile)
Status: Closed Package: mbstring related
PHP Version: 5.3.3 OS: Debian Linux 5
Private report: No CVE-ID: None
 [2010-09-27 10:08 UTC] mail at lutz-petzoldt dot de
Description:
------------
It seems like strripos isn't overloaded with mb_strripos when function overloading is enabled. Both functions return different values on a haystack that contains multibyte characters, e.g. german umlauts in my case.

Settings in php.ini:

mbstring.func_overload = 7
mbstring.internal_encoding = utf-8

Test script:
---------------
$string = '<body>Umlauttest öüä</body>';

var_dump(strlen($string));
var_dump(mb_strlen($string));

var_dump(strripos($string, '</body>'));
var_dump(mb_strripos($string, '</body>'));


Expected result:
----------------
int(27)
int(27)
int(20)
int(20)


Actual result:
--------------
int(27)
int(27)
int(23)
int(20)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-28 01:09 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=303805
Log: - Fixed bug #52931 (strripos not overloaded with function overloading enabled)
 [2010-09-28 01:09 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-09-28 01:09 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC