summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config.pm
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2016-10-13 02:41:36 +0200
committerGitHub <noreply@github.com>2016-10-13 02:41:36 +0200
commitdf4677439d7b3658e2d896ffaab903b01c2e2fe6 (patch)
treed9013dcffb7c60cd83c23865d1a086d632f17d84 /Bugzilla/Config.pm
parent31651c978e921e9e46cddd455f103fcf4b1a332a (diff)
downloadbugzilla-df4677439d7b3658e2d896ffaab903b01c2e2fe6.tar.gz
bugzilla-df4677439d7b3658e2d896ffaab903b01c2e2fe6.tar.xz
Bug 1301887 - File::Slurp triggers warnings on perl 5.24 and it is recommended to not use it (#21)
r=mtyson
Diffstat (limited to 'Bugzilla/Config.pm')
-rw-r--r--Bugzilla/Config.pm8
1 files changed, 3 insertions, 5 deletions
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