From 7a089d571590f9de96bd54840263ce5376404e66 Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Sat, 31 May 2008 19:57:57 +0000 Subject: [PATCH] fix undefined warning in apache cgi path PATH_INFO was intentionally declared undef in PLP::Backend::CGI, but would be concatenated later (in Apache mode at least), giving warnings since d9f3acb221a71e094318c7b5d3809aa81db (use warnings in all modules). --- lib/PLP/Backend/CGI.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PLP/Backend/CGI.pm b/lib/PLP/Backend/CGI.pm index 10b9b45..e952c5a 100644 --- a/lib/PLP/Backend/CGI.pm +++ b/lib/PLP/Backend/CGI.pm @@ -17,7 +17,7 @@ sub init { # Run backwards through PATH_TRANSLATED to find target filename, # then get file (relative) by stripping PATH_INFO. my ($path, $rel) = (delete $ENV{PATH_TRANSLATED}, delete $ENV{PATH_INFO}); - my $path_info; + my $path_info = ''; while (not -f $path) { if (not $path =~ s/(\/+[^\/]*)$//) { printf STDERR "PLP: Not found: $path$path_info ($ENV{REQUEST_URI})\n"; @@ -27,7 +27,7 @@ sub init { # move last path element onto PATH_INFO $path_info = $1 . $path_info; } - if (defined $path_info) { + if ($path_info ne '') { $rel =~ s/\Q$path_info\E$//; $ENV{PATH_INFO} = $path_info; } -- 2.30.0