Skip to content

Commit

Permalink
Item14033: Errors in testing for missing paths.
Browse files Browse the repository at this point in the history
Also possibility of an undef issue in Engine::CGI

Issues found by vrurg.
  • Loading branch information
gac410 committed Apr 9, 2016
1 parent 840c494 commit ec89a13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 4 additions & 1 deletion core/lib/Foswiki/Engine/CGI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,10 @@ sub preparePath {
# the switchboard.

my $dispatcher = $Foswiki::cfg{SwitchBoard}{$action};
my $reqobj = $dispatcher->{request} || 'Foswiki::Request';
my $reqobj =
( defined $dispatcher )
? $dispatcher->{request} || 'Foswiki::Request'
: 'Foswiki::Request';
eval qq(use $reqobj);
die Foswiki::encode_utf8($@) if $@;

Expand Down
3 changes: 1 addition & 2 deletions core/lib/Foswiki/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@ Ths following paths are supported:
sub parse {
my $query_path = shift;

my $web_path;
return {} unless defined $query_path && length($query_path);

print STDERR "Processing path ($query_path)\n" if TRACE;
my $topic_flag;
Expand All @@ -1021,7 +1021,6 @@ sub parse {
$topic_flag = 1;
}

return {} unless defined $query_path && length $query_path > 1;
$query_path =~ s{/+}{/}g; # Remove duplicate slashes

# trailingSlash Flag - hint that you want the web even if the topic exists
Expand Down

0 comments on commit ec89a13

Please sign in to comment.