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.
This commit is contained in:
Kevin Xiwei Zheng
2013-08-21 11:21:11 -04:00
parent d376f334ec
commit dcefb842df
2 changed files with 2 additions and 2 deletions

View File

@@ -14,7 +14,7 @@
<entry>
<title><%= post.presenter.humanized_essential_tag_string %></title>
<link href="http://<%= Danbooru.config.hostname %>/posts/<%= post.id %>" rel="alternate"/>
<% if post.source =~ /^http/ %>
<% if post.source =~ %r{\Ahttps?://} %>
<link href="<%= post.source %>" rel="related"/>
<% end %>
<id>http://<%= Danbooru.config.hostname %>/posts/<%= post.id %></id>