Skip to content

Commit

Permalink
[rss] Accept anything in the channel name if it's quoted
Browse files Browse the repository at this point in the history
  • Loading branch information
embolalia committed Jul 30, 2013
1 parent fba42df commit a73f0b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rss.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def manage_rss(bot, trigger):
pattern = r'''
^\.rss\s+add
\s+([&#+!][^\s,]+) # channel
\s+("[\w\s]+"|\w+) # name, which can contain spaces if quoted
\s+("[^"]+"|\w+) # name, which can contain anything but quotes if quoted
\s+(\S+) # url
(?:\s+(\d+))? # foreground colour (optional)
(?:\s+(\d+))? # background colour (optional)
Expand Down Expand Up @@ -194,7 +194,7 @@ def manage_rss(bot, trigger):
pattern = r"""
^\.rss\s+del
(?:\s+([&#+!][^\s,]+))? # channel (optional)
(?:\s+("[\w\s]+"|\w+))? # name (optional)
(?:\s+("[^"]+"|\w+))? # name (optional)
"""
match = re.match(pattern, trigger.group(), re.IGNORECASE | re.VERBOSE)
if match is None or (not match.group(1) and not match.group(2)):
Expand Down Expand Up @@ -223,7 +223,7 @@ def manage_rss(bot, trigger):
pattern = r"""
^\.rss\s+toggle
(?:\s+([&#+!][^\s,]+))? # channel (optional)
(?:\s+("[\w\s]+"|\w+))? # name (optional)
(?:\s+("[^"]+"|\w+))? # name (optional)
"""
match = re.match(pattern, trigger.group(), re.IGNORECASE | re.VERBOSE)
if match is None or (not match.group(1) and not match.group(2)):
Expand Down

0 comments on commit a73f0b0

Please sign in to comment.