Correctly escape special characters in RSS feed URLs #490

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+2 −0
Split
View
@@ -25,13 +25,15 @@
from r2.lib.template_helpers import add_sr, get_domain
from r2.models import FakeSubreddit
from r2.lib.filters import unsafe, safemarkdown
+ from urllib import quote_plus
%>
<%
permalink = add_sr(thing.permalink, force_hostname = True)
if thing.mousedown_url:
url = thing.mousedown_url
else:
url = permalink
+ url = quote_plus(url.encode('utf8'), '/:')
@spladug

spladug Aug 13, 2012

Owner

I think this would incorrectly urlencode the domain component of a URL with internationalized domain name, wouldn't it?

use_thumbs = thing.has_thumbnail and thing.thumbnail and not request.GET.has_key("nothumbs")
%>
<item>