JSJSONArrayParser: ignore garbage at end of JSON string
[videosite.git] / videosite / JSJSONArrayParser.pm
index 82c67f3..7a3b755 100644 (file)
@@ -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;