moriyoshi Fri Aug 1 22:58:20 2008 UTC Added files: (Branch: PHP_5_2) /php-src/ext/mbstring/tests bug43993.phpt
Modified files: /php-src NEWS /php-src/ext/mbstring/libmbfl/mbfl mbfilter.c Log: - MFH: Fixed bug #43993 (mb_substr_count() behaves differently to substr_count() with overlapping needles) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1185&r2=1.2027.2.547.2.1186&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1185 php-src/NEWS:1.2027.2.547.2.1186 --- php-src/NEWS:1.2027.2.547.2.1185 Thu Jul 31 17:39:13 2008 +++ php-src/NEWS Fri Aug 1 22:58:17 2008 @@ -58,6 +58,8 @@ (Dmitry, Tony) - Fixed bug #44127 (UNIX abstract namespace socket connect does not work). (Jani) +- Fixed bug #43993 (mb_substr_count() behaves differently to substr_count() with + overlapping needles). (Moriyoshi) - Fixed bug #41348 (OCI8: allow compilation with Oracle 8.1). (Chris Jones) 01 May 2008, PHP 5.2.6 http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c?r1=1.7.2.5.2.1&r2=1.7.2.5.2.2&diff_format=u Index: php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c diff -u php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c:1.7.2.5.2.1 php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c:1.7.2.5.2.2 --- php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c:1.7.2.5.2.1 Sun Aug 19 01:58:39 2007 +++ php-src/ext/mbstring/libmbfl/mbfl/mbfilter.c Fri Aug 1 22:58:20 2008 @@ -1013,6 +1013,7 @@ if (pc.matched_pos >= 0) { ++result; pc.matched_pos = -1; + pc.needle_pos = 0; } n--; } http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/tests/bug43993.phpt?view=markup&rev=1.1 Index: php-src/ext/mbstring/tests/bug43993.phpt +++ php-src/ext/mbstring/tests/bug43993.phpt --TEST-- Bug #43993 (mb_substr_count() behaves differently to substr_count() with overlapping needles) --SKIPIF-- <?php extension_loaded('mbstring') or die('skip mbstring not available'); ?> --FILE-- <?php var_dump(mb_substr_count("abcabcabca", "abcabc")); var_dump(mb_substr_count("abcabcabca", "abc")); var_dump(mb_substr_count("abcabcabca", "cab")); var_dump(mb_substr_count("abcabcabca", "bca")); var_dump(mb_substr_count("ababababab", "ba")); var_dump(mb_substr_count("ababababab", "ab")); var_dump(mb_substr_count("ababababab", "bc")); var_dump(mb_substr_count("aaaaaaaaaa", "a")); var_dump(mb_substr_count("aaaaaaaaaa", "b")); ?> --EXPECT-- int(1) int(3) int(2) int(3) int(4) int(5) int(0) int(10) int(0) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php