From bab58c68284783e066795614c8ae4782af6edc4e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Mon, 1 Dec 2008 19:23:53 +0000 Subject: - Strip all slashes from end and beginning of path in clean_path within traversal machinery. --- CHANGES.txt | 5 +++++ repoze/bfg/traversal.py | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 929b680ed..5426da283 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +Next release + + - Strip all slashes from end and beginning of path in clean_path + within traversal machinery. + 0.5.1 (11/25/2008) - Add ``keys``, ``items``, and ``values`` methods to diff --git a/repoze/bfg/traversal.py b/repoze/bfg/traversal.py index f6a415b85..4c5bb930d 100644 --- a/repoze/bfg/traversal.py +++ b/repoze/bfg/traversal.py @@ -11,11 +11,11 @@ from repoze.bfg.interfaces import ITraverser from repoze.bfg.interfaces import ITraverserFactory def split_path(path): - if path.startswith('/'): + while path.startswith('/'): path = path[1:] - if path.endswith('/'): + while path.endswith('/'): path = path[:-1] - clean=[] + clean = [] for segment in path.split('/'): segment = urllib.unquote(segment) # deal with spaces in path segment if not segment or segment=='.': -- cgit v1.2.3