FIX: URI must be ascii only for URI.parse command
This commit is contained in:
parent
c1ae562389
commit
e5affdf230
|
@ -1273,7 +1273,7 @@ SQL
|
||||||
end
|
end
|
||||||
|
|
||||||
def featured_link_root_domain
|
def featured_link_root_domain
|
||||||
MiniSuffix.domain(URI.parse(self.featured_link).hostname)
|
MiniSuffix.domain(URI.parse(URI.encode(self.featured_link)).hostname)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
@ -2101,6 +2101,7 @@ describe Topic do
|
||||||
"https://meta.discourse.org",
|
"https://meta.discourse.org",
|
||||||
"https://meta.discourse.org/",
|
"https://meta.discourse.org/",
|
||||||
"https://meta.discourse.org/?filter=test",
|
"https://meta.discourse.org/?filter=test",
|
||||||
|
"https://meta.discourse.org/t/中國/1",
|
||||||
].each do |featured_link|
|
].each do |featured_link|
|
||||||
it "should extract the root domain from #{featured_link} correctly" do
|
it "should extract the root domain from #{featured_link} correctly" do
|
||||||
topic.featured_link = featured_link
|
topic.featured_link = featured_link
|
||||||
|
|
Loading…
Reference in New Issue