修订版 | 1ff4e7c6cf3947780665cff3632dd2d504fa71d3 (tree) |
---|---|
时间 | 2019-06-17 18:09:23 |
作者 | hylom <hylom@user...> |
Commiter | hylom |
Plugin::ResponseFilter: fix to work correctly when 'result' attribue is scalar
@@ -23,7 +23,11 @@ sub register { | ||
23 | 23 | return if (!defined $args->{json}); |
24 | 24 | |
25 | 25 | my $json = $args->{json}; |
26 | - my $result = $json->{result} || $json; | |
26 | + my $result = $json; | |
27 | + if (defined $json->{result} && ref($json->{result} eq "HASH")) { | |
28 | + $result = $json->{result}; | |
29 | + } | |
30 | + | |
27 | 31 | if ($result->{item}) { |
28 | 32 | if ($result->{item}->{content_type}) { |
29 | 33 | apply_seclev_filter($c, $result->{item}->{content_type}, $result->{item}); |