diff options
author | Frédéric Buclin <LpSolit@netscape.net> | 2018-02-18 18:25:30 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@netscape.net> | 2018-02-18 18:25:30 +0100 |
commit | c52e3c6e8ad547ec035309994144fd22e2925267 (patch) | |
tree | d762218e6f71e302121d6112ad14deb5552201f8 /Bugzilla/Config.pm | |
parent | d966c278e6c653a90343c739ac5a48f4127cf7e0 (diff) | |
parent | 37784703eba80cb61d1734a11e09b62fa0eaeae9 (diff) | |
download | bugs-c52e3c6e8ad547ec035309994144fd22e2925267.tar bugs-c52e3c6e8ad547ec035309994144fd22e2925267.tar.gz bugs-c52e3c6e8ad547ec035309994144fd22e2925267.tar.bz2 bugs-c52e3c6e8ad547ec035309994144fd22e2925267.tar.xz bugs-c52e3c6e8ad547ec035309994144fd22e2925267.zip |
Sync with upstream release 5.0.4
Diffstat (limited to 'Bugzilla/Config.pm')
-rw-r--r-- | Bugzilla/Config.pm | 9 |
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 |