Skip to content

Commit

Permalink
Item1766: followed the path of least resistance, and reverted 1711, b…
Browse files Browse the repository at this point in the history
…ut making that fix still available

git-svn-id: http://svn.foswiki.org/branches/Release01x00@4776 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed Sep 5, 2009
1 parent 3bbaecd commit 1bd60b9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
6 changes: 5 additions & 1 deletion core/lib/Foswiki.pm
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,11 @@ sub cacheQuery {
$query->save( \*F );
close(F);

return '/foswiki_redirect_cache/' . $uid;
if ($Foswiki::cfg{UsePathForRedirectCache}) {
return '/foswiki_redirect_cache/' . $uid;
} else {
return '?foswiki_redirect_cache=' . $uid;
}
}

=begin TML
Expand Down
8 changes: 8 additions & 0 deletions core/lib/Foswiki.spec
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,14 @@ $Foswiki::cfg{RemovePortNumber} = $FALSE;
# disabled and set the {PermittedRedirectHostUrls}.
$Foswiki::cfg{AllowRedirectUrl} = $FALSE;
# **BOOLEAN EXPERT**
# Some authentication systems do not allow parameters to be passed in
# the target URL to be redirected to after authentication. In this case,
# Foswiki can be configured to encode the address of the parameter cache
# in the path information of the URL. Note that if you are using Apache
# rewriting rules, this may not work.
$Foswiki::cfg{UsePathForRedirectCache} = $FALSE;
# **REGEX EXPERT**
# Defines the filter-in regexp that must match the names of environment
# variables that can be seen using the %ENV{}% Foswiki variable. Set it to
Expand Down
11 changes: 8 additions & 3 deletions core/lib/Foswiki/UI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,19 @@ sub handleRequest {
$sub .= $dispatcher->{function};

# Get the params cache from the path
my $cache;
my $cache = $req->param('foswiki_redirect_cache');

# If the path specifies a cache path, use that. It's arbitrary
# as to which takes precedence (param or path) because we should
# never have both at once.
my $path_info = $req->path_info();
if ($path_info =~ s#/foswiki_redirect_cache/([a-f0-9]{32})$##) {
if ($path_info =~ s#/foswiki_redirect_cache/([a-f0-9]{32})##) {
$cache = $1;
$req->path_info( $path_info );
}

if ( $cache ) {
if ( defined $cache && $cache =~ /^([a-f0-9]{32})$/ ) {
$cache = $1; # untaint;

# Read cached post parameters
my $passthruFilename =
Expand Down

0 comments on commit 1bd60b9

Please sign in to comment.