diff options
author | Vitaly Belekhov <rmrf17@gmail.com> | 2018-01-04 22:50:05 +0700 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2018-01-04 10:50:05 -0500 |
commit | 842ac4647276ba5354289082adbdca75e0b19107 (patch) | |
tree | 1420238c5f275416b7aa0b4023c6dd6fdd618948 /Bugzilla/Template.pm | |
parent | 726dbd97cdf46a766ba8da6959594833ee03d65a (diff) | |
download | bugs-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/Template.pm')
-rw-r--r-- | Bugzilla/Template.pm | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 41b9265c6..decffe1e8 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -32,7 +32,6 @@ use Digest::MD5 qw(md5_hex); use File::Basename qw(basename dirname); use File::Find; use File::Path qw(rmtree mkpath); -use File::Slurp; use File::Spec; use IO::Dir; use List::MoreUtils qw(firstidx); @@ -502,7 +501,7 @@ sub _concatenate_css { next unless -e "$cgi_path/$files{$source}"; my $file = $skins_path . '/' . md5_hex($source) . '.css'; if (!-e $file) { - my $content = read_file("$cgi_path/$files{$source}"); + my $content = read_text("$cgi_path/$files{$source}"); # minify $content =~ s{/\*.*?\*/}{}sg; # comments @@ -512,7 +511,7 @@ sub _concatenate_css { # rewrite urls $content =~ s{url\(([^\)]+)\)}{_css_url_rewrite($source, $1)}eig; - write_file($file, "/* $files{$source} */\n" . $content . "\n"); + write_text($file, "/* $files{$source} */\n" . $content . "\n"); } push @minified, $file; } @@ -522,9 +521,9 @@ sub _concatenate_css { if (!-e $file) { my $content = ''; foreach my $source (@minified) { - $content .= read_file($source); + $content .= read_text($source); } - write_file($file, $content); + write_text($file, $content); } $file =~ s/^\Q$cgi_path\E\///o; @@ -563,7 +562,7 @@ sub _concatenate_js { next unless -e "$cgi_path/$files{$source}"; my $file = $skins_path . '/' . md5_hex($source) . '.js'; if (!-e $file) { - my $content = read_file("$cgi_path/$files{$source}"); + my $content = read_text("$cgi_path/$files{$source}"); # minimal minification $content =~ s#/\*.*?\*/##sg; # block comments @@ -572,7 +571,7 @@ sub _concatenate_js { $content =~ s#\n{2,}#\n#g; # blank lines $content =~ s#(^\s+|\s+$)##g; # whitespace at the start/end of file - write_file($file, ";/* $files{$source} */\n" . $content . "\n"); + write_text($file, ";/* $files{$source} */\n" . $content . "\n"); } push @minified, $file; } @@ -582,9 +581,9 @@ sub _concatenate_js { if (!-e $file) { my $content = ''; foreach my $source (@minified) { - $content .= read_file($source); + $content .= read_text($source); } - write_file($file, $content); + write_text($file, $content); } $file =~ s/^\Q$cgi_path\E\///o; |