• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Not a bug XenForo_ControllerHelper_Xml fails at  

Arty

Well-known member
#1
When importing style or any other XML document, controller uses this code
Code:
        $document = $this->getHelper('Xml')->getXmlFromFile($upload);
That code works fine for everything, but fails when content has   entity

This is sample valid XML document that function fails on
Code:
<?xml version="1.0" encoding="utf-8"?>
<email title="Test" customizer-version="2">
  <replacements>
    <replacement var="footerBlock">test &nbsp; test</replacement>
  </replacements>
</email>
 

Snog

Well-known member
#2
&nbsp isn't a valid XML named entity. Or at least is wasn't in the past.

XML does not have (or didn't have) any named entities besides &lt;, &gt;, &quot;, &apos; and &amp;.
 

Arty

Well-known member
#4
Sorry, this is invalid bug.

Well... bug is technically present because exporting and importing same content that has &nbsp; still causes error, but XenForo code has workaround for it creating child cdata nodes instead of setting value. So XenForo style import/export is not affected. I need to add same workaround to my add-on.