From 8d85069827d3324d1512068d9d380fe5f9976110 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Wed, 4 Oct 2006 10:52:32 +0000 Subject: [PATCH] return false on invalid mode and don't segfault --- ext/standard/string.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/standard/string.c b/ext/standard/string.c index fab460e265..9ad5f74e1f 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -6465,6 +6465,7 @@ PHP_FUNCTION(count_chars) } if (UG(unicode) && mode != 1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Only mode=1 is supported with Unicode strings"); + RETURN_FALSE; } } -- 2.50.1