aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Blondel <mathieu@mblondel.org>2007-05-27 21:17:47 +0000
committerMathieu BlondelMathieu Blondel <mathieu@mblondel.orgmathieu@mblondel.org>2007-05-27 21:17:47 +0000
commitfeda97671336a030016f640640de9f1027be8001 (patch)
tree78dd3a6322fdac7350d68d2d3c8324ca3fe5eed9
parentdb107c7074116525d81d79400aad136b8d919144 (diff)
downloadwikipediafs-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
-rw-r--r--ChangeLog9
-rw-r--r--src/wikipediafs/fs.py5
2 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index caa0dde..7e3c4ad 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,10 @@
-2007-05-26 Mathieu Blondel <mblondel@users.sourceforge.net>
+2007-05-2è Mathieu Blondel <mblondel@users.sourceforge.net>
+
+- Fixed the problem with articles having special characters like & (article.py).
-- article.py: encode urls. This fixes the problem with articles having special
-characters like &.
+- Made the man page optional in the install process (setup.py).
-- setup.py: make the man page optional in the install process.
+- Check invalid characters in article name. (fs.py)
=== WikipediaFS 0.3 ===
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: