From: Felipe Pena Date: Sat, 17 Jan 2009 20:36:22 +0000 (+0000) Subject: - Fixed bug #47102 (strripos issues unexpected warning with UNICODE haystack) (Notice... X-Git-Tag: php-5.4.0alpha1~191^2~4487 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca0451c6f9273a870bb6dbfa8263cd539216f2b1;p=php - Fixed bug #47102 (strripos issues unexpected warning with UNICODE haystack) (Noticed by Andy Wharmby) --- diff --git a/ext/standard/string.c b/ext/standard/string.c index c3f522ae9c..d85e8ada23 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -2913,7 +2913,7 @@ PHP_FUNCTION(strripos) if (haystack_type == IS_UNICODE) { if (offset >= 0) { U16_FWD_N(haystack.u, cu_offset, haystack_len, offset); - if (cu_offset > haystack_len - needle_len) { + if (cu_offset > haystack_len) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack string"); RETURN_FALSE; }