diff options
author | Mathieu Blondel <mathieu@mblondel.org> | 2007-05-27 15:07:24 +0000 |
---|---|---|
committer | Mathieu BlondelMathieu Blondel <mathieu@mblondel.orgmathieu@mblondel.org> | 2007-05-27 15:07:24 +0000 |
commit | a4e173409d4e43cf6e34fef9fb4110aecc117411 (patch) | |
tree | 614e07d464a7b910c71584617fd253ebd349d1d7 | |
parent | cc14af9df29b02142f92e45c96af2436902fe883 (diff) | |
download | wikipediafs-a4e173409d4e43cf6e34fef9fb4110aecc117411.tar.gz |
article.py: encode urls. This fixes the problem with articles having special
characters like &.
git-svn-id: http://svn.code.sf.net/p/wikipediafs/code/trunk@56 59acd704-e115-0410-a914-e735a229ed7c
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | src/wikipediafs/article.py | 12 |
2 files changed, 12 insertions, 5 deletions
@@ -1,5 +1,10 @@ 2007-05-26 Mathieu Blondel <mblondel@users.sourceforge.net> +- article.py: encode urls. This fixes the problem with articles having special +characters like &. + +2007-05-26 Mathieu Blondel <mblondel@users.sourceforge.net> + - Fixed a little problem in article.py. Spaces in article name must be replaced with underscores. diff --git a/src/wikipediafs/article.py b/src/wikipediafs/article.py index 9170f4e..f2d321d 100644 --- a/src/wikipediafs/article.py +++ b/src/wikipediafs/article.py @@ -66,13 +66,15 @@ class Article(SGMLParser): self.wpEditToken = None self.last_get = 0 - # url patterns - self.edit_page = "%s?title=%s&action=edit" % \ - (self.basename, self.name) + # url patterns + title = urllib.urlencode({"title" : self.name}) + + self.edit_page = "%s?%s&action=edit" % \ + (self.basename, title) # basename must include a leading / - self.submit_page = "%s?title=%s&action=submit" % \ - (self.basename, self.name) + self.submit_page = "%s?%s&action=submit" % \ + (self.basename, title) def start_textarea(self,attrs): """ |