##// END OF EJS Templates
path-permissions: Introduced a _get_f_path_unchecked method, which can be used by redirects, which don't have to create a template context
idlsoft -
r2620:807566df default
parent child Browse files
Show More
@@ -229,13 +229,19 b' class RepoAppView(BaseAppView):'
229
229
230 return c
230 return c
231
231
232 def _get_f_path(self, matchdict, default=None):
232 def _get_f_path_unchecked(self, matchdict, default=None):
233 """
234 Should only be used by redirects, everything else should call _get_f_path
235 """
233 f_path = matchdict.get('f_path')
236 f_path = matchdict.get('f_path')
234 if f_path:
237 if f_path:
235 # fix for multiple initial slashes that causes errors for GIT
238 # fix for multiple initial slashes that causes errors for GIT
236 return self.path_filter.assert_path_permissions(f_path.lstrip('/'))
239 return f_path.lstrip('/')
237
240
238 return self.path_filter.assert_path_permissions(default)
241 return default
242
243 def _get_f_path(self, matchdict, default=None):
244 return self.path_filter.assert_path_permissions(self._get_f_path_unchecked(matchdict, default))
239
245
240
246
241 class PathFilter(object):
247 class PathFilter(object):
@@ -462,7 +462,7 b' class RepoFilesView(RepoAppView):'
462 """
462 """
463 Kept only to make OLD links work
463 Kept only to make OLD links work
464 """
464 """
465 f_path = self._get_f_path(self.request.matchdict)
465 f_path = self._get_f_path_unchecked(self.request.matchdict)
466 diff1 = self.request.GET.get('diff1', '')
466 diff1 = self.request.GET.get('diff1', '')
467 diff2 = self.request.GET.get('diff2', '')
467 diff2 = self.request.GET.get('diff2', '')
468
468
General Comments 0
You need to be logged in to leave comments. Login now