Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[title] Restrict accepted URLs (only https?://)
  • Loading branch information
sfan5 committed Mar 26, 2016
1 parent 113c7f8 commit 03fd6b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion title.py
Expand Up @@ -14,10 +14,12 @@ def title(phenny, input):
uri = input.group(2)
if uri:
uri = uri.strip()
if not uri.startswith("http://") and not uri.startswith("https://"):
return phenny.say("That's not a valid URL")
elif hasattr(phenny.bot, 'last_seen_uri'):
uri = phenny.bot.last_seen_uri
else:
return phenny.reply("Give me an URI..")
return phenny.reply("Give me a link.")
data, sc = web.get(uri, 16384)
if sc != 200:
return phenny.say("HTTP error %d" % sc)
Expand Down

0 comments on commit 03fd6b2

Please sign in to comment.