From e5e5c53128eadeb6ebd4168b0f85200afeb9dbec Mon Sep 17 00:00:00 2001 From: Frank Doepper Date: Mon, 9 Apr 2012 15:34:08 +0200 Subject: [PATCH] 20120408 broke lighttpd --- index.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.pl b/index.pl index a3b91d2..223b878 100755 --- a/index.pl +++ b/index.pl @@ -4,7 +4,7 @@ # http://woffs.de/WCM # # -# 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 { -- 2.45.2