~woffs/wcm

d10804fc4b9bb8baaead6855c937aac17fd6585c — Frank Doepper 12 years ago 6673ddd
take length of appended QUERY_STRING in count
1 files changed, 4 insertions(+), 3 deletions(-)

M index.pl
M index.pl => index.pl +4 -3
@@ 4,7 4,7 @@
# http://woffs.de/WCM
# <wcm@woffs.de>
#
# 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,.*/,,;