Skip to content

Commit 42a4a25

Browse files
committed
Fix to always try JSON::XS first if available webmin/webmin#2222
1 parent b7b9e29 commit 42a4a25

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

stats.pl

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
use lib ("$ENV{'PERLLIB'}/vendor_perl");
1010
use Net::WebSocket::Server;
1111
use utf8;
12-
use JSON::PP;
12+
eval "use JSON::XS qw(encode_json decode_json);";
13+
if ($@) {
14+
eval "use JSON::PP qw(encode_json decode_json);";
15+
}
1316

1417
our ($current_theme);
1518
require($ENV{'THEME_ROOT'} . "/stats-lib.pl");

0 commit comments

Comments
 (0)