Move tests on image filename before redirecting to more appropriate place.
This commit is contained in:
parent
566c8bffd0
commit
32ebd6a318
@ -127,7 +127,11 @@ Redirect =
|
||||
url
|
||||
|
||||
file: (archive, {boardID, filename}) ->
|
||||
filename = encodeURIComponent $.unescape decodeURIComponent filename if boardID is 'f'
|
||||
return '' unless filename
|
||||
if boardID is 'f'
|
||||
filename = encodeURIComponent $.unescape decodeURIComponent filename
|
||||
else
|
||||
return '' if /[sm]\.jpg$/.test(filename)
|
||||
"#{Redirect.protocol archive}#{archive.domain}/#{boardID}/full_image/#{filename}"
|
||||
|
||||
board: (archive, {boardID}) ->
|
||||
|
||||
@ -157,7 +157,6 @@ Main =
|
||||
return
|
||||
|
||||
if ImageHost.test hostname
|
||||
return unless pathname[2] and not /[sm]\.jpg$/.test(pathname[2])
|
||||
$.asap (-> d.readyState isnt 'loading'), ->
|
||||
if Conf['404 Redirect'] and g.SITE.is404?()
|
||||
Redirect.navigate 'file', {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user