aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla/Config.pm
diff options
context:
space:
mode:
authorVitaly Belekhov <rmrf17@gmail.com>2018-01-04 22:50:05 +0700
committerDylan William Hardison <dylan@hardison.net>2018-01-04 10:50:05 -0500
commit842ac4647276ba5354289082adbdca75e0b19107 (patch)
tree1420238c5f275416b7aa0b4023c6dd6fdd618948 /Bugzilla/Config.pm
parent726dbd97cdf46a766ba8da6959594833ee03d65a (diff)
downloadbugs-842ac4647276ba5354289082adbdca75e0b19107.tar
bugs-842ac4647276ba5354289082adbdca75e0b19107.tar.gz
bugs-842ac4647276ba5354289082adbdca75e0b19107.tar.bz2
bugs-842ac4647276ba5354289082adbdca75e0b19107.tar.xz
bugs-842ac4647276ba5354289082adbdca75e0b19107.zip
Bug 1301887 - File::Slurp triggers warnings on perl 5.24 (#53)
* Bug 1301887 - File::Slurp triggers warnings on perl 5.24 and it is recommended to not use it (#21) r=mtyson * Fix for vrite in aa735d4 * Added https://gitweb.gentoo.org/proj/gentoo-bugzilla.git/commit/?id=ca7bfc9c485c959fad2aee1f7c1dbc0fb484553b
Diffstat (limited to 'Bugzilla/Config.pm')
-rw-r--r--Bugzilla/Config.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm
index 1c02d9dda..458616701 100644
--- a/Bugzilla/Config.pm
+++ b/Bugzilla/Config.pm
@@ -16,10 +16,9 @@ use autodie qw(:default);
use Bugzilla::Constants;
use Bugzilla::Hook;
-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;
@@ -284,7 +283,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.
@@ -301,8 +300,8 @@ 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
# missing, we don't want JSON::XS to leak the content of the file