From df4677439d7b3658e2d896ffaab903b01c2e2fe6 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Wed, 12 Oct 2016 17:41:36 -0700 Subject: Bug 1301887 - File::Slurp triggers warnings on perl 5.24 and it is recommended to not use it (#21) r=mtyson --- Bugzilla/Config.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Bugzilla/Config.pm') diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm index 49918d5c1..8bd774b70 100644 --- a/Bugzilla/Config.pm +++ b/Bugzilla/Config.pm @@ -17,10 +17,9 @@ use autodie qw(:default); use Bugzilla::Constants; use Bugzilla::Hook; use Bugzilla::Install::Util qw(i_am_persistent); -use Bugzilla::Util qw(trick_taint); +use Bugzilla::Util qw(trick_taint read_text write_text); use JSON::XS; -use File::Slurp; use File::Temp; use File::Basename; @@ -301,7 +300,7 @@ sub write_params { my $param_file = bz_locations()->{'datadir'} . '/params.json'; my $json_data = JSON::XS->new->canonical->pretty->encode($param_data); - write_file($param_file, { binmode => ':utf8', atomic => 1 }, \$json_data); + write_text($param_file, $json_data); # It's not common to edit parameters and loading # Bugzilla::Install::Filesystem is slow. @@ -318,8 +317,7 @@ sub read_param_file { my $file = bz_locations()->{'datadir'} . '/params.json'; if (-e $file) { - my $data; - read_file($file, binmode => ':utf8', buf_ref => \$data); + my $data = read_text($file); trick_taint($data); # If params.json has been manually edited and e.g. some quotes are -- cgit v1.2.3-24-g4f1b