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