2
0
mirror of https://github.com/WikiTeam/wikiteam synced 2024-11-04 12:00:28 +00:00

ampersand in titles

git-svn-id: https://wikiteam.googlecode.com/svn/trunk@55 31edc4fc-5e31-b4c4-d58b-c8bc928bcb95
This commit is contained in:
emijrp 2011-04-10 09:17:05 +00:00
parent da8bacb40d
commit c5af8540c2

View File

@ -209,7 +209,9 @@ def getXMLPage(config={}, title=''):
#http://www.mediawiki.org/wiki/Manual_talk:Parameters_to_Special:Export#Parameters_no_longer_in_use.3F
limit = 1000
truncated = False
title_ = re.sub(' ', '_', title)
title_ = title
title_ = re.sub(' ', '_', title_)
title_ = re.sub('&', '%26', title_) # titles with & need to be converted into %26
headers = {'User-Agent': getUserAgent()}
params = {'title': 'Special:Export', 'pages': title_, 'action': 'submit', }
if config['curonly']:
@ -267,6 +269,7 @@ def getXMLPage(config={}, title=''):
return xml
def cleanXML(xml=''):
#do not touch xml codification, as is
xml = xml.split('</siteinfo>\n')[1]
xml = xml.split('</mediawiki>')[0]
return xml