Skip to content
Snippets Groups Projects
Commit 5ba03ac7 authored by DaveD's avatar DaveD
Browse files

check null first

parent c3efce13
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