summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/string.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 1c9ee20d69..1b8916ec0b 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1890,6 +1890,10 @@ PHP_FUNCTION(chunk_split)
RETURN_FALSE;
}
+ if (chunklen > Z_STRLEN_PP(p_str)) {
+ RETURN_STRINGL(Z_STRVAL_PP(p_str), Z_STRLEN_PP(p_str), 1);
+ }
+
if (!Z_STRLEN_PP(p_str)) {
RETURN_EMPTY_STRING();
}