From eb1d920c17b678bc1349905fa60b1ae78e7ef8d0 Mon Sep 17 00:00:00 2001 From: Toks Date: Tue, 11 Aug 2015 20:29:32 -0400 Subject: [PATCH] #2489 fix src redirect --- app/models/post.rb | 2 +- test/unit/post_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/post.rb b/app/models/post.rb index 42d495cc0..657a5e179 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -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 diff --git a/test/unit/post_test.rb b/test/unit/post_test.rb index d400cedfe..1af7da0b9 100644 --- a/test/unit/post_test.rb +++ b/test/unit/post_test.rb @@ -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