aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorHolger Dürer <me@hdurer.net>2017-06-05 18:19:18 +0100
committerJohnson Denen <johnson.denen@gmail.com>2017-06-19 13:50:14 -0400
commitc5c2e565f5569753b343ae70388f39b0191911d9 (patch)
tree86025d7a55239949934723155408bd217c8c5216 /lisp
parenta9e595142eee69fe84f0ab06f7fde76cef27cdac (diff)
More robust bad url detection.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-media.el7
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."