aboutsummaryrefslogtreecommitdiffstats
path: root/bn_django/git_wiki/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'bn_django/git_wiki/models.py')
-rw-r--r--bn_django/git_wiki/models.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/bn_django/git_wiki/models.py b/bn_django/git_wiki/models.py
index 3023500..f0a7e9c 100644
--- a/bn_django/git_wiki/models.py
+++ b/bn_django/git_wiki/models.py
@@ -17,7 +17,7 @@ class Tree(models.Model):
type = 'tree'
def slug(self):
#TODO: secure this
- return ''.join(self.path.strip().lower().split())
+ return ''.join(self.path.replace('"','').replace("'","").strip().lower().split())
class Admin:
ordering = ['path','name']
@@ -72,7 +72,7 @@ class Item(models.Model):
type='blob'
def slug(self):
#TODO: secure this
- return ''.join(self.name.strip().lower().split())
+ return ''.join(self.name.replace('"','').replace("'","").strip().lower().split())
class Admin:
ordering = ['path','name']
@@ -173,7 +173,7 @@ def fromslug(reqslug):
ret.reqslug = '/'
return ret
- reqslug = ''.join(reqslug.strip().lower().split())
+ reqslug = ''.join(reqslug.replace('"','').replace("'","").strip().lower().split())
if reqslug[-1] == '/':
reqslug=reqslug[:-1]
itemtxt = commands.getoutput(GITPREFIX \
@@ -190,7 +190,7 @@ def fromslug(reqslug):
fpath = ' '.join(words[3:])
if fpath[-1] == '/':
fpath=fpath[:-1]
- if ''.join(fpath.strip().lower().split()) == reqslug:
+ if ''.join(fpath.replace('"','').replace("'","").strip().lower().split()) == reqslug:
hash = fhash
path = fpath
type = ftype