From 78adb387fd6ee95b20748ef1d4b97249b6dc5aa7 Mon Sep 17 00:00:00 2001 From: SirLouen Date: Tue, 9 Dec 2025 18:43:18 +0100 Subject: [PATCH] Performance: Early Return for strip_tags --- ext/standard/string.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/standard/string.c b/ext/standard/string.c index 0b7d5be1a257..9fb48c78ef78 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -5123,6 +5123,11 @@ PHPAPI size_t php_strip_tags_ex(char *rbuf, size_t len, const char *allow, size_ char *allow_free = NULL; char is_xml = 0; + if (len == 0) { + *rbuf = '\0'; + return 0; + } + buf = estrndup(rbuf, len); end = buf + len; lc = '\0';