Permalink
Browse files

Merge pull request #1099 from smokris/patch-2

Only apply Perl 5.20 CGI workaround when needed
  • Loading branch information...
sumpfralle committed Oct 4, 2018
2 parents e8345b5 + 11d4ed1 commit 9030517d6b8797f40198e5577497a6bfd7747002
Showing with 6 additions and 4 deletions.
  1. +6 −4 master/_bin/munin-cgi-html.in
@@ -168,7 +168,9 @@ sub get_node_service {
# CGI in perl 5.20 is now seriously broken as it doesn't import into the namespace.
# So we have to delegate explicitely. It's easier than prefixing with CGI:: each use.
sub header { return CGI::header(@_); }
sub path_info { return CGI::path_info(@_); }
sub url { return CGI::url(@_); }
sub script_name { return CGI::script_name(@_); }
if(!defined &header){
*header = sub { return CGI::header(@_); };
*path_info = sub { return CGI::path_info(@_); };
*url = sub { return CGI::url(@_); };
*script_name = sub { return CGI::script_name(@_); };
}

0 comments on commit 9030517

Please sign in to comment.