fixes #1215
This commit is contained in:
@@ -18,9 +18,15 @@ module PostsHelper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def post_source_tag(post)
|
def post_source_tag(post)
|
||||||
if post.source =~ /^http/
|
if post.source =~ %r!http://img\d+\.pixiv\.net/img/([^\/]+)/!
|
||||||
text = truncate(post.normalized_source.sub(/^https?:\/\//, ""))
|
text = "pixiv/#{$1}"
|
||||||
link_to(truncate(text, :length => 15), post.normalized_source)
|
link_to(text, post.normalized_source)
|
||||||
|
elsif post.source =~ %r!http://i\d\.pixiv\.net/img\d+/img/([^\/]+)/!
|
||||||
|
text = "pixiv/#{$1}"
|
||||||
|
link_to(text, post.normalized_source)
|
||||||
|
elsif post.source =~ /^http/
|
||||||
|
text = truncate(post.normalized_source.sub(/^https?:\/\/(?:www)?/, ""))
|
||||||
|
link_to(truncate(text, :length => 20), post.normalized_source)
|
||||||
else
|
else
|
||||||
truncate(post.source, :length => 100)
|
truncate(post.source, :length => 100)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ class PostPruner
|
|||||||
end
|
end
|
||||||
|
|
||||||
def prune!
|
def prune!
|
||||||
prune_pending!
|
Post.without_timeout do
|
||||||
prune_flagged!
|
prune_pending!
|
||||||
prune_mod_actions!
|
prune_flagged!
|
||||||
|
prune_mod_actions!
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|||||||
Reference in New Issue
Block a user