~woffs/wcm

e5e5c53128eadeb6ebd4168b0f85200afeb9dbec — Frank Doepper 11 years ago b96099b 20120409
20120408 broke lighttpd
1 files changed, 3 insertions(+), 2 deletions(-)

M index.pl
M index.pl => index.pl +3 -2
@@ 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 {