FIX: Remove trailing slash from topic URL

FIX: Remove trailing slash from topic URL

this lead to duplicate slashes in concatenated URLs

diff --git a/app/models/topic.rb b/app/models/topic.rb
index 0d26ca5..9a45a32 100644
--- a/app/models/topic.rb
+++ b/app/models/topic.rb
@@ -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

GitHub sha: 53d22327

2 Likes