Skip to content
Browse files

xss fix from Steven Chamberlain

  • Loading branch information...
1 parent af24c78 commit bad9f9c28f0939b269f90072aa4cf41f20f15563 @oetiker committed Mar 17, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/Smokeping.pm
View
5 lib/Smokeping.pm
@@ -1028,8 +1028,9 @@ sub smokecol ($) {
sub parse_datetime($){
my $in = shift;
- for ($in){
- /^(\d+)$/ && do { my $value = $1; $value = time if $value > 2**32; return $value};
+ for ($in){
+ $in =~ s/$xssBadRx/_/g;
+ /^(\d+)$/ && do { my $value = $1; $value = time if $value > 2**32; return $value};
/^\s*(\d{4})-(\d{1,2})-(\d{1,2})(?:\s+(\d{1,2}):(\d{2})(?::(\d{2}))?)?\s*$/ &&
return POSIX::mktime($6||0,$5||0,$4||0,$3,$2-1,$1-1900,0,0,-1);
/^now$/ && return time;

0 comments on commit bad9f9c

Please sign in to comment.
Something went wrong with that request. Please try again.