diff options
| author | Chris McDonough <chrism@agendaless.com> | 2008-12-01 19:23:53 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2008-12-01 19:23:53 +0000 |
| commit | bab58c68284783e066795614c8ae4782af6edc4e (patch) | |
| tree | 7c8589abd67164408b46dbeb5665794f1343db1e /repoze | |
| parent | c68421c2f818dd50660fda05b5c31b5fbf1f6416 (diff) | |
| download | pyramid-bab58c68284783e066795614c8ae4782af6edc4e.tar.gz pyramid-bab58c68284783e066795614c8ae4782af6edc4e.tar.bz2 pyramid-bab58c68284783e066795614c8ae4782af6edc4e.zip | |
- Strip all slashes from end and beginning of path in clean_path
within traversal machinery.
Diffstat (limited to 'repoze')
| -rw-r--r-- | repoze/bfg/traversal.py | 6 |
1 files changed, 3 insertions, 3 deletions
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=='.': |
