Skip to content
Permalink
Browse files
[title] Restrict accepted URLs (only https?://)
  • Loading branch information
sfan5 committed Mar 26, 2016
1 parent 113c7f8 commit 03fd6b20179130bc3d078ed6cca18df2a40b7574
Showing 1 changed file with 3 additions and 1 deletion.
@@ -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)

0 comments on commit 03fd6b2

Please sign in to comment.