Changeset f79d6a2


Ignore:
Timestamp:
Dec 5, 2008, 11:21:35 PM (12 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, debian, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
9375f8c
Parents:
2209f16
Message:
IRC: Escape interpolated variables in regexes using "\Q\E".
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perl/modules/IRC/lib/BarnOwl/Message/IRC.pm

    r38a7f22 rf79d6a2  
    3333        @filter  =
    3434             (qw{( type ^irc$ and filter personal and },
    35               qw{( ( direction ^in$ and sender}, "^$who\$",
    36               qw{ ) or ( direction ^out$ and recipient}, "^$who\$",
     35              qw{( ( direction ^in$ and sender}, "^\Q$who\E\$",
     36              qw{ ) or ( direction ^out$ and recipient}, "^\Q$who\E\$",
    3737              qw{) ) ) });
    3838        BarnOwl::command("filter", "$filter", @filter);
     
    4747            $filter = "irc-$network-channel-$channel-$sender-$1";
    4848            @filter =
    49                  (qw{type ^irc$ and network}, "^$network\$",
    50                   qw{and channel}, "^$channel\$",
    51                   qw{and ( sender}, "^$sender\$",
    52                   qw{or sender}, "^$1\$",qq{)});
     49                 (qw{type ^irc$ and network}, "^\Q$network\E\$",
     50                  qw{and channel}, "^\Q$channel\E\$",
     51                  qw{and ( sender}, "^\Q$sender\E\$",
     52                  qw{or sender}, "^\Q$1\E\$",qq{)});
    5353        } else {
    5454            $filter = "irc-$network-channel-$channel";
    55             @filter = (qw{type ^irc$ and network}, "^$network\$",
    56                        qw{and channel}, "^$channel\$");
     55            @filter = (qw{type ^irc$ and network}, "^\Q$network\E\$",
     56                       qw{and channel}, "^\Q$channel\E\$");
    5757        }
    5858        BarnOwl::command("filter", "$filter", @filter);
Note: See TracChangeset for help on using the changeset viewer.