Skip to content

Commit

Permalink
Item13578: Don't guess ../ relative paths for pub
Browse files Browse the repository at this point in the history
Not really sure if this is the right thing to do.  Needs testing, and
discussion about when a relative pub path would be required.
  • Loading branch information
gac410 committed Sep 10, 2016
1 parent 259a4b2 commit 5eb4527
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion core/lib/Foswiki/Configure/Bootstrap.pm
Expand Up @@ -555,7 +555,14 @@ sub bootstrapWebSettings {

# This might not work, depending on the websrver config,
# but it's the best we can do
$Foswiki::cfg{PubUrlPath} = "$1/../pub";
my $lslash = rindex( $1, '/' );
if ( $lslash >= 0 ) {
$Foswiki::cfg{PubUrlPath} = $1;
substr( $Foswiki::cfg{PubUrlPath}, $lslash + 1 ) = 'pub';
}
else {
$Foswiki::cfg{PubUrlPath} = "$1/../pub";
}
}
else {
print STDERR "AUTOCONFIG: Building Short URL paths using prefix $pfx \n"
Expand Down

0 comments on commit 5eb4527

Please sign in to comment.