diff options
author | Holger Dürer <me@hdurer.net> | 2017-06-05 18:19:18 +0100 |
---|---|---|
committer | Johnson Denen <johnson.denen@gmail.com> | 2017-06-19 13:46:27 -0400 |
commit | 0108cd1e7abf621cf65a89e4f6ad12f8dcaa2eed (patch) | |
tree | 86025d7a55239949934723155408bd217c8c5216 /lisp | |
parent | a9e595142eee69fe84f0ab06f7fde76cef27cdac (diff) |
More robust bad url detection.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-media.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/mastodon-media.el b/lisp/mastodon-media.el index f5d67ca..0a4c3de 100644 --- a/lisp/mastodon-media.el +++ b/lisp/mastodon-media.el @@ -201,9 +201,10 @@ found." "Checks to make sure that the missing string has not been returned." - (let ((missing "/files/small/missing.png")) - (and link - (not (equal link missing))))) + (and link + (> (length link) 8) + (or (string= "http://" (substring link 0 7)) + (string= "https://" (substring link 0 8))))) (defun mastodon-media--inline-images () "Find all `Media_Links:' in the buffer replacing them with the referenced image." |