]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
-month parameter can accept format -month=D not only -month=DD
authoreldy <>
Sun, 23 Mar 2003 15:34:09 +0000 (15:34 +0000)
committereldy <>
Sun, 23 Mar 2003 15:34:09 +0000 (15:34 +0000)
wwwroot/cgi-bin/awstats.pl

index 2b600bebb2278fa96b54f8fb55dc05a039cbaa61..c8cd25ea2f208b7fd0c087b44a92899b6bcda54b 100644 (file)
@@ -4603,9 +4603,9 @@ $QueryString=~s/(^|&)output(&|$)//i; $QueryString=~s/&+$//;
 if ($QueryString =~ /(^|&)month=(year)/i) { error("month=year is a deprecated option. Use month=all instead."); }
 if ($QueryString =~ /(^|&)year=(\d\d\d\d)/i) { $YearRequired="$2"; }
 else { $YearRequired="$nowyear"; }
-if ($QueryString =~ /(^|&)month=(\d\d)/i || $QueryString =~ /(^|&)month=(all)/i) { $MonthRequired="$2"; }
+if ($QueryString =~ /(^|&)month=(\d{1,2})/i || $QueryString =~ /(^|&)month=(all)/i) { $MonthRequired=sprintf("%02d",$2); }
 else { $MonthRequired="$nowmonth"; }
-if ($QueryString =~ /(^|&)day=(\d\d)/i) { $DayRequired="$2"; } # day is a hidden option. Must not be used (Make results not understandable). Available for users that rename history files with day.
+if ($QueryString =~ /(^|&)day=(\d{1,2})/i) { $DayRequired=sprintf("%02d",$2); }        # day is a hidden option. Must not be used (Make results not understandable). Available for users that rename history files with day.
 else { $DayRequired=''; }
 
 # Print AWStats and Perl version