FIX: Remove trailing slash from topic URL

this lead to duplicate slashes in concatenated URLs
This commit is contained in:
Gerhard Schlager 2019-05-13 14:51:45 +02:00
parent df18243827
commit 53d2232731

View File

@ -1001,7 +1001,7 @@ class Topic < ActiveRecord::Base
end
def self.url(id, slug, post_number = nil)
url = +"#{Discourse.base_url}/t/#{slug}/#{id}/"
url = +"#{Discourse.base_url}/t/#{slug}/#{id}"
url << "/#{post_number}" if post_number.to_i > 1
url
end