summaryrefslogtreecommitdiff
path: root/MyProxy.pl
diff options
context:
space:
mode:
authordakkar <dakkar@luxion>2007-01-04 18:06:16 +0000
committerdakkar <dakkar@luxion>2007-01-04 18:06:16 +0000
commit301af24615e8d6847f38f3135751f171d2edbc51 (patch)
tree0c60885f9aebdeface8ebd9c4447d9895723fec4 /MyProxy.pl
parentcorretto il counter js (diff)
downloadmyProxy-301af24615e8d6847f38f3135751f171d2edbc51.tar.gz
myProxy-301af24615e8d6847f38f3135751f171d2edbc51.tar.bz2
myProxy-301af24615e8d6847f38f3135751f171d2edbc51.zip
i pattern non validi vengono ignorati, aggiunti pattern per evitare i loop in nytimes
git-svn-id: svn://luxion/repos/myProxy/trunk@239 fcb26f47-9200-0410-b104-b98ab5b095f3
Diffstat (limited to 'MyProxy.pl')
-rwxr-xr-xMyProxy.pl10
1 files changed, 7 insertions, 3 deletions
diff --git a/MyProxy.pl b/MyProxy.pl
index f7af9fb..df1cda4 100755
--- a/MyProxy.pl
+++ b/MyProxy.pl
@@ -27,10 +27,13 @@ sub subptn2re {
sub ptn2re {
my ($pat)=@_;
- $pat=~s|([.\@\%\$?+])|\\$1|g; # quote specials
+ $pat=~s|([.\@\%\$+])|\\$1|g; # quote specials
+ $pat=~s|([^(])(\?)|$1\\$2|g; # quote some question marks
$pat=~s|/+|/+|g; # turn slashes into "/+"
$pat=~s:(\\.|[^*\\]|\*+):subptn2re($1):ge; # expand wildcards
- return qr{^$pat$};
+ my $ret=eval{qr{^$pat$}};
+ return if $@;
+ return $ret;
}
my %ACTIONS=(
@@ -68,7 +71,8 @@ sub addPattern {
$addPatternLogger->error("Unknown action $action, skipping");
return;
}
- push @PATTERNS,[ptn2re($match),@{$ACTIONS{$action}},@parms];
+ my $re=ptn2re($match);
+ push @PATTERNS,[$re,@{$ACTIONS{$action}},@parms] if $re;
}
my $loadPatternsLogger=Log::Log4perl->get_logger('MyProxy.load.loadPatterns');