Skip to content
Snippets Groups Projects
Unverified Commit 86713de5 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub
Browse files

Merge pull request #23589 from demeritcowboy/null

php8.1 - Check null first before sending to strlen
parents 36f871a8 5ba03ac7
Branches
Tags
No related merge requests found
......@@ -19,13 +19,14 @@
* @return integer
*/
function smarty_modifier_crmCountCharacters($string, $include_spaces = FALSE) {
if (is_null($string)) {
return 0;
}
if ($include_spaces) {
return(strlen($string));
}
if (is_null($string)) {
return 0;
}
return preg_match_all("/[^\s]/", $string, $match);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment