diff --git a/PBot/Utils/ValidateString.pm b/PBot/Utils/ValidateString.pm index 6a119ab0..b73531e6 100644 --- a/PBot/Utils/ValidateString.pm +++ b/PBot/Utils/ValidateString.pm @@ -17,6 +17,7 @@ sub validate_string { return $string if not defined $string or not length $string; $max_length = 1024 * 8 if not defined $max_length; + local $@; eval { my $h = decode_json($string); foreach my $k (keys %$h) { $h->{$k} = substr $h->{$k}, 0, $max_length unless $max_length <= 0; }