From c1f62d16127ccf1f5ce705e7a3aa8e407d34092a Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 13 Apr 2015 01:28:11 -0700 Subject: [PATCH] Don't crash if link (which could be from archive) is not a 4chan filename. --- src/General/lib/post.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/General/lib/post.class b/src/General/lib/post.class index 6ca9229a1..2cce8bb31 100755 --- a/src/General/lib/post.class +++ b/src/General/lib/post.class @@ -183,7 +183,7 @@ class Post if (thumb = $ '.fileThumb > [data-md5]', fileEl) $.extend @file, thumb: thumb - thumbURL: "#{location.protocol}//i.4cdn.org/#{@board}/#{link.href.match(/(\d+)\./)[1]}s.jpg" + thumbURL: if m = link.href.match(/\d+(?=\.\w+$)/) then "#{location.protocol}//i.4cdn.org/#{@board}/#{m[0]}s.jpg" MD5: thumb.dataset.md5 isSpoiler: $.hasClass thumb.parentNode, 'imgspoiler'