From d376f334eca35d7cda4375461337dcf785874dab Mon Sep 17 00:00:00 2001 From: r888888888 Date: Tue, 20 Aug 2013 18:37:32 -0700 Subject: [PATCH 1/2] update version --- config/danbooru_default_config.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/danbooru_default_config.rb b/config/danbooru_default_config.rb index e22fa323e..fa0e39fe3 100644 --- a/config/danbooru_default_config.rb +++ b/config/danbooru_default_config.rb @@ -4,7 +4,7 @@ module Danbooru class Configuration # The version of this Danbooru. def version - "2.28.2" + "2.29.0" end # The name of this Danbooru. From dcefb842dfb3e31d27e52ea9490b7fa0d5a19ee8 Mon Sep 17 00:00:00 2001 From: Kevin Xiwei Zheng Date: Wed, 21 Aug 2013 11:21:11 -0400 Subject: [PATCH 2/2] More accurately determine linkable sources Use the "\A" metacharacter for the beginning of a string, instead of "^" for the beginning of any line within that string, and check for "://" as well. Fixes #1947. --- app/helpers/posts_helper.rb | 2 +- app/views/posts/index.atom.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/posts_helper.rb b/app/helpers/posts_helper.rb index d1e27edec..11fc0f60d 100644 --- a/app/helpers/posts_helper.rb +++ b/app/helpers/posts_helper.rb @@ -26,7 +26,7 @@ module PostsHelper text = "pixiv/#{$1}" source_link = link_to(text, post.normalized_source) source_search = "source:#{text}/" - elsif post.source =~ /^http/ + elsif post.source =~ %r{\Ahttps?://} text = truncate(post.normalized_source.sub(/^https?:\/\/(?:www\.)?/, "")) source_link = link_to(truncate(text, :length => 20), post.normalized_source) source_search = "source:#{post.source.sub(/[^\/]*$/, "")}" diff --git a/app/views/posts/index.atom.erb b/app/views/posts/index.atom.erb index 598bf1c9f..a0159ba17 100644 --- a/app/views/posts/index.atom.erb +++ b/app/views/posts/index.atom.erb @@ -14,7 +14,7 @@ <%= post.presenter.humanized_essential_tag_string %> - <% if post.source =~ /^http/ %> + <% if post.source =~ %r{\Ahttps?://} %> <% end %> http://<%= Danbooru.config.hostname %>/posts/<%= post.id %>