#2489 fix src redirect

This commit is contained in:
Toks
2015-08-11 20:29:32 -04:00
parent 8e17b4936a
commit eb1d920c17
2 changed files with 2 additions and 2 deletions

View File

@@ -358,7 +358,7 @@ class Post < ActiveRecord::Base
when %r{\Ahttp://p\.twpl\.jp/show/orig/([a-z0-9]+)}i
"http://p.twipple.jp/#{$1}"
when %r{\Ahttps?://pictures\.hentai-foundry\.com//?[^/]/([^/]+)/(\d+)\.}i
when %r{\Ahttps?://pictures\.hentai-foundry\.com//?[^/]/([^/]+)/(\d+)}i
"http://www.hentai-foundry.com/pictures/user/#{$1}/#{$2}"
when %r{\Ahttp://blog(?:(?:-imgs-)?\d*(?:-origin)?)?\.fc2\.com/(?:(?:[^/]/){3}|(?:[^/]/))([^/]+)/(?:file/)?([^\.]+\.[^\?]+)}i

View File

@@ -960,7 +960,7 @@ class PostTest < ActiveSupport::TestCase
@post.source = "http://pictures.hentai-foundry.com//a/AnimeFlux/219123.jpg"
assert_equal("http://www.hentai-foundry.com/pictures/user/AnimeFlux/219123", @post.normalized_source)
@post.source = "http://pictures.hentai-foundry.com/a/AnimeFlux/219123.jpg"
@post.source = "http://pictures.hentai-foundry.com/a/AnimeFlux/219123/Mobile-Suit-Equestria-rainbow-run.jpg"
assert_equal("http://www.hentai-foundry.com/pictures/user/AnimeFlux/219123", @post.normalized_source)
end
end