From 42857cd552983aa37500a5d7aa48bee752c9e9aa Mon Sep 17 00:00:00 2001 From: ghostrigger Date: Wed, 2 Jul 2014 08:23:18 +0800 Subject: [PATCH] fixes #2215 hopefully * improved domain support * renamed archived files will be redirected to the latest version; users still have to click 'File history' to view the old ones note: it appears wikia doesn't support yet #filehistory and #mediaviewer from wikipedia --- app/models/post.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index 8388532ec..0e9f9e739 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -339,7 +339,7 @@ class Post < ActiveRecord::Base when %r{\Ahttp://(?:(?:s?img|cdn|www)\d?\.)?gelbooru\.com/{1,2}(?:images|samples)/\d+/(?:sample_)?([a-f0-9]{32})\.}i "http://gelbooru.com/index.php?page=post&s=list&md5=#{$1}" - when %r{\Ahttps?://(?:slot\d*\.)?im(?:g|ages)\d*\.wikia\.nocookie\.net/(?:_{2}cb\d{14}/)?([^/]+)(?:/[a-z]{2})?/images/(?:(?:thumb|archive)?/)?[a-f0-9]/[a-f0-9]{2}/([^/]+)}i + when %r{\Ahttps?://(?:slot\d*\.)?im(?:g|ages)\d*\.wikia\.(?:nocookie\.net|com)/(?:_{2}cb\d{14}/)?([^/]+)(?:/[a-z]{2})?/images/(?:(?:thumb|archive)?/)?[a-f0-9]/[a-f0-9]{2}/(?:\d{14}(?:!|%21))?([^/]+)}i subdomain = $1 filename = $2 "http://#{subdomain}.wikia.com/wiki/File:#{filename}"