From aedf7360ae2ac6e69d0b2009603c46eedb0af7a2 Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Sat, 12 Apr 2014 18:31:46 +0200 Subject: [PATCH] JSJSONArrayParser: ignore garbage at end of JSON string --- videosite/JSJSONArrayParser.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/videosite/JSJSONArrayParser.pm b/videosite/JSJSONArrayParser.pm index 82c67f3..7a3b755 100644 --- a/videosite/JSJSONArrayParser.pm +++ b/videosite/JSJSONArrayParser.pm @@ -24,8 +24,10 @@ sub parse { my $self = shift; my $s = shift; my $j = JSON->new(); + my $content; - return $j->loose->allow_barekey()->allow_singlequote()->decode($s); + ($content, undef) = $j->loose->allow_barekey()->allow_singlequote()->decode_prefix($s); + return $content; } 1; -- 1.8.3.1