Skip to content

Commit

Permalink
[FIX] ensure all g_inner content is correctly encoded
Browse files Browse the repository at this point in the history
fixes odoo#1130

* provided `inner` data may or may not have been encoded
* `element.text` is either ascii-compatible `str` or `unicode` when
  non-ascii-compatible, which could force the decoding of utf8-encoded content
  during g_inner's join
  • Loading branch information
xmo-odoo committed Jul 14, 2014
1 parent 7c540bc commit 7a2961d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions openerp/addons/base/ir/ir_qweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,9 @@ def render_element(self, element, template_attributes, generated_attributes, qwe
# qwebcontext: values
# inner: optional innerXml
if inner:
g_inner = inner
g_inner = inner.encode('utf-8') if isinstance(inner, unicode) else inner
else:
g_inner = [] if element.text is None else [element.text]
g_inner = [] if element.text is None else [element.text.encode('utf-8')]
for current_node in element.iterchildren(tag=etree.Element):
try:
g_inner.append(self.render_node(current_node, qwebcontext))
Expand Down

0 comments on commit 7a2961d

Please sign in to comment.