Skip to content

Commit

Permalink
Adding checks for internal spaces in text that could be interpreted a…
Browse files Browse the repository at this point in the history
…s a url (but shouldnt)
  • Loading branch information
Peter Benzoni committed Jun 20, 2024
1 parent a584088 commit 6066784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ def format_url(url):
parsed_url = urlparse(url)

# If the URL lacks a domain, return None.
if '.' not in url:
if '.' not in url or ' ' in url:
return None
# If the URL lacks both scheme and netloc, attempt to prepend "http://".
elif parsed_url.scheme == "" and parsed_url.netloc == "":
Expand Down

0 comments on commit 6066784

Please sign in to comment.