From d10804fc4b9bb8baaead6855c937aac17fd6585c Mon Sep 17 00:00:00 2001 From: Frank Doepper Date: Sat, 7 May 2011 14:32:10 +0200 Subject: [PATCH] take length of appended QUERY_STRING in count --- index.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.pl b/index.pl index e500e10..03a1c67 100755 --- a/index.pl +++ b/index.pl @@ -4,7 +4,7 @@ # http://woffs.de/WCM # # -# Version 20110505 +# Version 20110506 # # © WofFS 2010 # License: CC-BY-SA 3.0 @@ -132,9 +132,10 @@ use sigtrap qw/die ALRM/; alarm 180; # max. seconds # which page requested -$current=$1 if $ENV{'QUERY_STRING'} and $ENV{'QUERY_STRING'}=~/^page=([^&]*)/; +$current=$1 if $ENV{'QUERY_STRING'} and $ENV{'QUERY_STRING'}=~/^page=([^&]*)(&.*)?$/; +my $clen=$2?length($2):0; $current=~s/%([0-9A-F]{2})/sprintf("%c",hex($1))/gei; # urldecode -my $clen=length($current); +$clen+=length($current); $current=~s,/*$,,; # strip trailing / ($bcurrent=$current)=~s,.*/,,; -- 2.45.2