]> granicus.if.org Git - php/commitdiff
- Fixed bug #52931 (strripos not overloaded with function overloading enabled)
authorFelipe Pena <felipe@php.net>
Mon, 27 Sep 2010 23:09:00 +0000 (23:09 +0000)
committerFelipe Pena <felipe@php.net>
Mon, 27 Sep 2010 23:09:00 +0000 (23:09 +0000)
NEWS
ext/mbstring/mbstring.c
ext/mbstring/tests/bug52931.phpt [new file with mode: 0644]

diff --git a/NEWS b/NEWS
index d69a709bfe79a1c2f63124e1c25a64f4baadf94a..6d8d00e2b2d1944e4ed6c2274f49d812f247f40e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,8 @@
 - Fixed possible crash in mssql_fetch_batch(). (Kalle)
 - Fixed inconsistent backlog default value (-1) in FPM on many systems. (fat)
 
+- Fixed bug #52931 (strripos not overloaded with function overloading enabled).
+  (Felipe)
 - Fixed bug #52929 (Segfault in filter_var with FILTER_VALIDATE_EMAIL with
   large amount of data). (Adam)
 - Fixed bug #52926 (zlib fopen wrapper does not use context). (Gustavo)
index ef11db31a31cb7d9670d93ed44ce25cb33ebf308..f67d0fb5699011f3930af4aa8bfa935f1d6e25c9 100644 (file)
@@ -196,7 +196,7 @@ static const struct mb_overload_def mb_ovld[] = {
        {MB_OVERLOAD_STRING, "strpos", "mb_strpos", "mb_orig_strpos"},
        {MB_OVERLOAD_STRING, "strrpos", "mb_strrpos", "mb_orig_strrpos"},
        {MB_OVERLOAD_STRING, "stripos", "mb_stripos", "mb_orig_stripos"},
-       {MB_OVERLOAD_STRING, "strripos", "mb_strripos", "mb_orig_stripos"},
+       {MB_OVERLOAD_STRING, "strripos", "mb_strripos", "mb_orig_strripos"},
        {MB_OVERLOAD_STRING, "strstr", "mb_strstr", "mb_orig_strstr"},
        {MB_OVERLOAD_STRING, "strrchr", "mb_strrchr", "mb_orig_strrchr"},
        {MB_OVERLOAD_STRING, "stristr", "mb_stristr", "mb_orig_stristr"},
diff --git a/ext/mbstring/tests/bug52931.phpt b/ext/mbstring/tests/bug52931.phpt
new file mode 100644 (file)
index 0000000..9669d88
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+Bug #52931 (strripos not overloaded with function overloading enabled)
+--INI--
+mbstring.func_overload = 7
+mbstring.internal_encoding = utf-8
+--FILE--
+<?php
+
+$string = '<body>Umlauttest öüä</body>';
+
+var_dump(strlen($string));
+var_dump(mb_strlen($string));
+
+var_dump(strripos($string, '</body>'));
+var_dump(mb_strripos($string, '</body>'));
+
+?>
+--EXPECTF--
+int(27)
+int(27)
+int(20)
+int(20)