@@ 4,7 4,7 @@
# http://woffs.de/WCM
# <wcm@woffs.de>
#
-# Version 20120408
+# Version 20120409
#
# © WofFS 2010
# License: CC-BY-SA 3.0
@@ 134,8 134,8 @@ alarm 180; # max. seconds
# which page requested
$current=$1 if $ENV{'QUERY_STRING'} and $ENV{'QUERY_STRING'}=~/^page=([^&]*)(&.*)?$/;
my $clen=$2?length($2):0;
-$clen+=length($current);
$current=~s/%([0-9A-F]{2})/sprintf("%c",hex($1))/gei; # urldecode
+$clen+=length($current);
$current=~s,/*$,,; # strip trailing /
($bcurrent=$current)=~s,.*/,,;
@@ 147,6 147,7 @@ $host=~s/:.*$//; # fnord
$abs='http'.($https eq 'on' ? 's' : '').
"://$host".($port == ($https eq 'on' ? 443 : 80) ? '' : ":$port");
if (my $ru=$ENV{REQUEST_URI}) {
+ $ru=~s/%([0-9A-F]{2})/sprintf("%c",hex($1))/gei if $ru=~/%25/; # apache double urldecode
$ru=~s/%([0-9A-F]{2})/sprintf("%c",hex($1))/gei; # urldecode
$abs.=substr($ru,0,length($ru)-$clen);
} else {