Skip to content

Commit

Permalink
fix: handle null string input in substring function
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnsultan committed Jan 30, 2025
1 parent 0a019e4 commit 9e720c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Globals.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function require_files(){
*/
function substring($string, $length, $end = ' ...'){

if(strlen($string) > $length)
if(strlen($string ?? '') > $length)
return substr($string, 0, $length) . $end;

return $string;
Expand Down

0 comments on commit 9e720c3

Please sign in to comment.