--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -1,4 +1,5 @@
import logging
+import urllib
import tg
import pymongo
@@ -380,7 +381,7 @@
def url(self):
if self.thread:
- return self.thread.url() + self.slug + '/'
+ return self.thread.url() + urllib.quote_plus(self.slug) + '/'
else: # pragma no cover
return None
@@ -461,10 +462,10 @@
def url(self):
if self.post_id:
- return self.post.url() + 'attachment/' + self.filename
+ return self.post.url() + 'attachment/' + urllib.quote_plus(self.filename)
elif self.thread_id:
- return self.thread.url() + 'attachment/' + self.filename
+ return self.thread.url() + 'attachment/' + urllib.quote_plus(self.filename)
else:
- return self.discussion.url() + 'attachment/' + self.filename
-
-
+ return self.discussion.url() + 'attachment/' + urllib.quote_plus(self.filename)
+
+