From bb8c79deb85b9982009a805c77676c35a33ed277 Mon Sep 17 00:00:00 2001 From: root Date: Fri, 23 Apr 2021 00:45:02 +0000 Subject: Fix some bugs --- Inject/Handler.pm | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/Inject/Handler.pm b/Inject/Handler.pm index adeec57..98d4713 100644 --- a/Inject/Handler.pm +++ b/Inject/Handler.pm @@ -8,17 +8,20 @@ use Apache2::RequestUtil (); use Apache2::Const qw/OK DECLINED/; my $doc = qr{ - (? *]>.*? - | - ( ]*>.*? - | ]*> - | ]*> - | ]*> - | ]*>.*? - | ]*>.*? # n.b. - | ]*>.*? # n.b. - | ]*>.*? # n.b.! - )+ ) + (? \s* # common way to trigger quirks mode + (]*>)? \s* + ( ]*>.*? \s* + | ( ]*>.*? \s* + | ]*> \s* + | ]*> \s* + | ]*> \s* + | ]*>.*? \s* + | ]*>.*? \s* # n.b. + | ]*>.*? \s* # n.b. + | ]*>.*? \s* # n.b.! + )+ + ) + )? (? .* ) }xms; @@ -29,7 +32,7 @@ sub handler { my $content = ${$r->slurp_filename}; return DECLINED if not $content =~ /$doc/; - print $+{head}; + print $+{head} if $+{head}; print "Injection 1\n"; print $+{body}; print "Injection 2\n"; -- cgit v1.2.3