From 79e9d06047a7ccdb305be6b1b59f3016ef4d41fb Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 16 Jun 2014 11:20:10 -0700 Subject: [PATCH] Fix errors due to tag in file info on /s4s/ --- CHANGELOG.md | 3 +++ src/General/lib/post.class | 7 +++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 210d64b53..29e77926a 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +**ccd0** +- Fix errors due to tag in file info on /s4s/. + ### v1.7.61 *2014-06-15* diff --git a/src/General/lib/post.class b/src/General/lib/post.class index f3175e33b..fa9f681d7 100755 --- a/src/General/lib/post.class +++ b/src/General/lib/post.class @@ -132,11 +132,10 @@ class Post "#{location.protocol}//t.4cdn.org/#{@board}/#{@file.URL.match(/(\d+)\./)[1]}s.jpg" @file.isImage = /(jpg|png|gif)$/i.test @file.URL @file.isVideo = /webm$/i.test @file.URL + nameNode = $ 'a', fileText if @file.isImage or @file.isVideo - @file.dimensions = fileText.childNodes[2].textContent.match(/\d+x\d+/)?[0] - @file.name = fileText.title or do -> - nameNode = $('span', fileText) or $('a', fileText) - nameNode?.title or nameNode?.textContent + @file.dimensions = nameNode.nextSibling.textContent.match(/\d+x\d+/)[0] + @file.name = fileText.title or nameNode.title or nameNode.textContent cleanup: (root) -> for node in $$ '.mobile', root