Commit c2e2d0bf authored by Andreas Jung's avatar Andreas Jung

set output-encoding for uploaded XML files always to UTF-8

parent 19eead51
...@@ -305,7 +305,10 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable, ...@@ -305,7 +305,10 @@ class ZopePageTemplate(Script, PageTemplate, Historical, Cacheable,
text = REQUEST.get('BODY', '') text = REQUEST.get('BODY', '')
content_type = guess_type('', text) content_type = guess_type('', text)
encoding = sniffEncoding(text, self.output_encoding) encoding = sniffEncoding(text, self.output_encoding)
self.output_encoding = encoding if content_type == 'text/xml':
self.output_encoding = 'utf-8'
else:
self.output_encoding = encoding
self.pt_edit(text, content_type, encoding) self.pt_edit(text, content_type, encoding)
RESPONSE.setStatus(204) RESPONSE.setStatus(204)
return RESPONSE return RESPONSE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment