Subject: | Path regex matching gives warnings when @args is empty |
If there are no action args for a path, then ActionDispatch gives the
following warning:
[Mon Dec 1 11:19:48 2008] search.t: Use of uninitialized value in
substitution (s///) at
.../local/lib/site_perl/5.8.8/CGI/Application/Plugin/ActionDispatch.pm
line 119.
[Mon Dec 1 11:19:48 2008] search.t: Use of uninitialized value in split
at
.../local/lib/site_perl/5.8.8/CGI/Application/Plugin/ActionDispatch.pm
line 120.
The following patch prevents it:
--- CGI/Application/Plugin/ActionDispatch.pm.old Sat Sep 20
17:31:48 2008
+++ CGI/Application/Plugin/ActionDispatch.pm Mon Dec 1 11:15:05 2008
@@ -115,7 +115,7 @@
# done by counting the args, and finding the Path with
# the fewest amount of args left over.
if($type eq 'Path') {
- if(@args) {
+ if(defined($args[0])) {
$args[0] =~ s/^\///;
@path_args = split('/', $args[0]);
}