From 3602d13fe7687a3b931ba037365191307e99da8d Mon Sep 17 00:00:00 2001 From: Holger Dürer Date: Mon, 5 Jun 2017 18:19:18 +0100 Subject: More robust bad url detection. --- lisp/mastodon-media.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-media.el') 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." -- cgit v1.2.3