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. --- repoze/bfg/traversal.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'repoze') 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