From 0af0cd83382bbb70fa2f033fdc96ad8a4b3888d0 Mon Sep 17 00:00:00 2001 From: Koen Eelen Date: Fri, 14 Aug 2020 11:41:52 +0200 Subject: [PATCH] BUGFIX substr() broke when passing a NULL because of strict type in case mb mod not installed --- src/Monolog/Utils.php | 2 +- test.php | 0 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 test.php diff --git a/src/Monolog/Utils.php b/src/Monolog/Utils.php index 007ad686..7515eadb 100644 --- a/src/Monolog/Utils.php +++ b/src/Monolog/Utils.php @@ -31,7 +31,7 @@ final class Utils return mb_strcut($string, $start, $length); } - return substr($string, $start, $length); + return substr($string, $start, $length ?: strlen($string)); } /** diff --git a/test.php b/test.php new file mode 100644 index 00000000..e69de29b