nicdumz@svn.wikimedia.org ha scritto:
Revision: 6568 Author: nicdumz Date: 2009-04-01 11:18:59 +0000 (Wed, 01 Apr 2009)
Log Message:
Cleaning previous commit :
- Cleaning scrubxml() implementation
- Applying scrubxml AFTER decoding the string to unicode
[...]
- def scrubxml(self,xml):
- def scrubxml(self, xml): """scrub the start of xml input, to make things work, even
[...]
when crap is inserted ahead of the actual xml data.
(such as when php reports strict warnings)"""
start = xml.find('<?xml')
if start < 0:
# '<?xml' not found ? Should not happen.
return ""
return xml[start:]
scrubxml() is a member of Site class, this looks as wrong. Is a new function really necessary?
Data truncation when find() doesn't return a value >= 0 may be omitted too.