Update archive redirection method.

This commit is contained in:
Nicolas Stepien 2012-07-01 11:47:21 +02:00
parent a6bf046f8c
commit 5c3b7ec9b1
3 changed files with 6 additions and 4 deletions

View File

@ -4433,7 +4433,7 @@
case 'images.4chan.org':
$.ready(function() {
var url;
if (d.title === '4chan - 404' && Conf['404 Redirect']) {
if (/^4chan - 404/.test(d.title) && Conf['404 Redirect']) {
path = location.pathname.split('/');
url = Redirect.image(path[1], path[3]);
if (url) {
@ -4537,7 +4537,7 @@
},
ready: function() {
var MutationObserver, a, board, nav, node, nodes, observer, _i, _j, _len, _len1, _ref, _ref1;
if (d.title === '4chan - 404') {
if (/^4chan - 404/.test(d.title)) {
if (Conf['404 Redirect'] && /^\d+$/.test(g.THREAD_ID)) {
location.href = Redirect.thread(g.BOARD, g.THREAD_ID, location.hash);
}

View File

@ -1,4 +1,6 @@
master
- Mayhem
Update/fix archive redirection method.
2.33.5
- Mayhem

View File

@ -3414,7 +3414,7 @@ Main =
return
when 'images.4chan.org'
$.ready ->
if d.title is '4chan - 404' and Conf['404 Redirect']
if /^4chan - 404/.test(d.title) and Conf['404 Redirect']
path = location.pathname.split '/'
url = Redirect.image path[1], path[3]
location.href = url if url
@ -3512,7 +3512,7 @@ Main =
$.ready Main.ready
ready: ->
if d.title is '4chan - 404'
if /^4chan - 404/.test d.title
if Conf['404 Redirect'] and /^\d+$/.test g.THREAD_ID
location.href = Redirect.thread g.BOARD, g.THREAD_ID, location.hash
return