Skip to content

Commit

Permalink
Fixes OpenToAllCTF#204 Change regex to capture complete URL
Browse files Browse the repository at this point in the history
  • Loading branch information
r00tdaemon committed Jun 6, 2019
1 parent 40b4bb8 commit bab4af2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion handlers/linksave_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def execute(cls, slack_wrapper, args, timestamp, channel_id, user_id, user_is_ad

message = slack_wrapper.get_message(channel_id, timestamp)["messages"][0]["text"]
profile_details = slack_wrapper.get_member(user_id)["user"]["profile"]
url_regex = "((https?):\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?"
# http://www.noah.org/wiki/RegEx_Python#URL_regex_pattern
url_regex = "http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+"
url = re.search(url_regex, message)

if not url:
Expand Down

0 comments on commit bab4af2

Please sign in to comment.