From: Dmitry Stogov Date: Wed, 7 Sep 2005 07:00:03 +0000 (+0000) Subject: Fixed unicode support for substr_count() X-Git-Tag: RELEASE_0_9_0~276 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=18e259480eb3a354aeaf4e3beda598ec02dafadb;p=php Fixed unicode support for substr_count() --- diff --git a/ext/standard/string.c b/ext/standard/string.c index c474d9d27b..fbeed23a45 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -5273,7 +5273,7 @@ PHP_FUNCTION(substr_count) if (haystack_type == IS_UNICODE) { while ((p = zend_u_memnstr((UChar *)p, (UChar *)needle, needle_len, (UChar *)endp)) != NULL) { /*(UChar *)p += needle_len; // GCC 4.0.0 cannot compile this */ - p = (UChar *)p + UBYTES(needle_len); + p = (UChar *)p + needle_len; count++; } } else {