diff --git a/r2/r2/lib/menus.py b/r2/r2/lib/menus.py index 4120b7572..73edd1186 100644 --- a/r2/r2/lib/menus.py +++ b/r2/r2/lib/menus.py @@ -24,6 +24,7 @@ from pylons import c, request, g from utils import query_string, timeago from strings import StringHandler, plurals from r2.lib.db import operators +from r2.lib.filters import _force_unicode from pylons.i18n import _ #from r2.config import cache @@ -259,7 +260,7 @@ class NavButton(Styled): p = {} base_path = ("%s/%s/" % (base_path, self.dest)).replace('//', '/') - self.bare_path = base_path.replace('//', '/') + self.bare_path = _force_unicode(base_path.replace('//', '/')).lower() # append the query string base_path += query_string(p) @@ -273,7 +274,7 @@ class NavButton(Styled): if self.opt: return request.params.get(self.opt, '') in self.aliases else: - stripped_path = request.path.rstrip('/') + stripped_path = _force_unicode(request.path.rstrip('/')).lower() if stripped_path == self.bare_path.rstrip('/'): return True if stripped_path in (a.rstrip('/') for a in self.aliases): diff --git a/r2/r2/lib/utils/utils.py b/r2/r2/lib/utils/utils.py index 011cda27e..2353ba5b2 100644 --- a/r2/r2/lib/utils/utils.py +++ b/r2/r2/lib/utils/utils.py @@ -755,6 +755,7 @@ def title_to_url(title, max_length = 50): title = rx_notsafe.sub('', title) #remove non-printables title = rx_underscore.sub('_', title) #remove double underscores title = title.strip('_') #remove trailing underscores + title = title.lower() #lowercase the title if len(title) > max_length: #truncate to nearest word diff --git a/r2/r2/templates/comment.html b/r2/r2/templates/comment.html index de2873a49..29c7f86c3 100644 --- a/r2/r2/templates/comment.html +++ b/r2/r2/templates/comment.html @@ -113,7 +113,7 @@ ${parent.midcol()} <% fullname = thing._fullname %>