diff options
author | dakkar <dakkar@luxion> | 2007-01-04 18:06:16 +0000 |
---|---|---|
committer | dakkar <dakkar@luxion> | 2007-01-04 18:06:16 +0000 |
commit | 301af24615e8d6847f38f3135751f171d2edbc51 (patch) | |
tree | 0c60885f9aebdeface8ebd9c4447d9895723fec4 /MyProxy.pl | |
parent | corretto il counter js (diff) | |
download | myProxy-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-x | MyProxy.pl | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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'); |