diff options
author | Mathieu Blondel <mathieu@mblondel.org> | 2007-05-27 21:17:47 +0000 |
---|---|---|
committer | Mathieu BlondelMathieu Blondel <mathieu@mblondel.orgmathieu@mblondel.org> | 2007-05-27 21:17:47 +0000 |
commit | feda97671336a030016f640640de9f1027be8001 (patch) | |
tree | 78dd3a6322fdac7350d68d2d3c8324ca3fe5eed9 /src | |
parent | db107c7074116525d81d79400aad136b8d919144 (diff) | |
download | wikipediafs-feda97671336a030016f640640de9f1027be8001.tar.gz |
Check invalid characters in article name. (fs.py)
git-svn-id: http://svn.code.sf.net/p/wikipediafs/code/trunk@59 59acd704-e115-0410-a914-e735a229ed7c
Diffstat (limited to 'src')
-rw-r--r-- | src/wikipediafs/fs.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wikipediafs/fs.py b/src/wikipediafs/fs.py index 3792129..78dcf5e 100644 --- a/src/wikipediafs/fs.py +++ b/src/wikipediafs/fs.py @@ -42,6 +42,11 @@ class ArticleDir: def is_valid_file(self, path): file_name = self.get_article_file_name(path) + + for forbidden_char in ('#', '<', '>', '[', ']', '|', '{', '}'): + if file_name.count(forbidden_char) > 0: + return False + if file_name[-3:] == ".mw": return True else: |