Skip to content

Commit

Permalink
Item13969: Set proper default web/topic for rest
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Feb 23, 2016
1 parent 4ceee33 commit 505307a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/lib/Foswiki.pm
Expand Up @@ -2206,7 +2206,12 @@ sub new {
# bin/script?topic=WebPreferences;defaultweb=Sandbox
my $defaultweb = $query->param('defaultweb') || $Foswiki::cfg{UsersWebName};

my $webtopic = urlDecode( $query->path_info() || '' );
# Scripts like rest, jsonrpc, don't use web/topic path.
my $webtopic = '';
unless ( $query->action() eq 'rest' || $query->action() eq 'jsonrpc' ) {
$webtopic = urlDecode( $query->path_info() || '' );
}

my $topicOverride = '';
my $topic = $query->param('topic');
if ( defined $topic ) {
Expand All @@ -2223,9 +2228,6 @@ sub new {
}
}

# SMELL Scripts like rest, jsonrpc, don't use web/topic path.
# So this ends up all bogus, but doesn't do any harm.

( my $web, $topic ) =
$this->_parsePath( $webtopic, $defaultweb, $topicOverride );

Expand Down

0 comments on commit 505307a

Please sign in to comment.