Changeset 9375f8c


Ignore:
Timestamp:
Dec 5, 2008, 11:39:14 PM (16 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
1d12db24
Parents:
f79d6a2
Message:
Jabber: Escape interpolated variables in regexes using "\Q\E".
File:
1 edited

Legend:

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

    r96134cb r9375f8c  
    7070        $filter = "jabber-room-$room";
    7171        BarnOwl::command(qw[filter], $filter,
    72                          qw[type ^jabber$ and room], "^$room\$");
     72                         qw[type ^jabber$ and room], "^\Q$room\E\$");
    7373        return $filter;
    7474    } elsif ($self->login ne 'none') {
     
    8484    my $filter = "jabber-user-$user";
    8585    BarnOwl::command(qw[filter], $filter, qw[type ^jabber$],
    86                      qw[and ( ( direction ^in$ and from], "^$user",
    87                      qw[) or ( direction ^out$ and to ], "^$user",
     86                     qw[and ( ( direction ^in$ and from], "^\Q$user\E(/.*)?\$",
     87                     qw[) or ( direction ^out$ and to ], "^\Q$user\E(/.*)?\$",
    8888                     qw[ ) ) ]);
    8989    return $filter;
Note: See TracChangeset for help on using the changeset viewer.