diff --git a/helpers/common.php b/helpers/common.php index 576ecaf..6b6f124 100644 --- a/helpers/common.php +++ b/helpers/common.php @@ -10,6 +10,9 @@ if (!function_exists('bear_str_to_lower')) { function bear_str_to_lower($str) { + if ($str === null) { + return null; + } if (function_exists('mb_strtolower')) { return mb_strtolower($str, 'UTF-8'); } @@ -20,6 +23,9 @@ function bear_str_to_lower($str) if (!function_exists('bear_str_to_upper')) { function bear_str_to_upper($str) { + if ($str === null) { + return null; + } if (function_exists('mb_strtoupper')) { return mb_strtoupper($str, 'UTF-8'); } @@ -30,6 +36,9 @@ function bear_str_to_upper($str) if (!function_exists('bear_str_length')) { function bear_str_length($str) { + if ($str === null) { + return null; + } if (function_exists('mb_strlen')) { return mb_strlen($str); }