0

Hey I regularly get this error in my System.log. Can someone help me or say what's the reason?

main.CRITICAL: Warning: SimpleXMLElement::addChild(): unterminated entity reference              EB in /var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Convert/ConvertArray.php on line 93 [{"function":"handler","class":"Magento\\Framework\\App\\ErrorHandler","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Convert/ConvertArray.php","line":93,"function":"addChild","class":"SimpleXMLElement","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Convert/ConvertArray.php","line":100,"function":"_assocToXml","class":"Magento\\Framework\\Convert\\ConvertArray","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Convert/ConvertArray.php","line":100,"function":"_assocToXml","class":"Magento\\Framework\\Convert\\ConvertArray","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Convert/ConvertArray.php","line":47,"function":"_assocToXml","class":"Magento\\Framework\\Convert\\ConvertArray","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/opengento/module-gdpr/Service/Export/Renderer/XmlRenderer.php","line":38,"function":"assocToXml","class":"Magento\\Framework\\Convert\\ConvertArray","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/opengento/module-gdpr/Service/Export/Renderer/AbstractRenderer.php","line":37,"function":"render","class":"Opengento\\Gdpr\\Service\\Export\\Renderer\\XmlRenderer","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/opengento/module-gdpr/Model/Export/ExportToFile.php","line":62,"function":"saveData","class":"Opengento\\Gdpr\\Service\\Export\\Renderer\\AbstractRenderer","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/opengento/module-gdpr/Model/ExportEntityManagement.php","line":84,"function":"export","class":"Opengento\\Gdpr\\Model\\Export\\ExportToFile","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/opengento/module-gdpr/Cron/ExportEntity.php","line":59,"function":"export","class":"Opengento\\Gdpr\\Model\\ExportEntityManagement","type":"->"},{"function":"execute","class":"Opengento\\Gdpr\\Cron\\ExportEntity","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php","line":368,"function":"call_user_func_array"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php","line":879,"function":"_runJob","class":"Magento\\Cron\\Observer\\ProcessCronQueueObserver","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php","line":840,"function":"tryRunJob","class":"Magento\\Cron\\Observer\\ProcessCronQueueObserver","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/module-cron/Observer/ProcessCronQueueObserver.php","line":280,"function":"processPendingJobs","class":"Magento\\Cron\\Observer\\ProcessCronQueueObserver","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Event/Invoker/InvokerDefault.php","line":88,"function":"execute","class":"Magento\\Cron\\Observer\\ProcessCronQueueObserver","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Event/Invoker/InvokerDefault.php","line":74,"function":"_callObserverMethod","class":"Magento\\Framework\\Event\\Invoker\\InvokerDefault","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Event/Manager.php","line":65,"function":"dispatch","class":"Magento\\Framework\\Event\\Invoker\\InvokerDefault","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/generated/code/Magento/Framework/Event/Manager/Proxy.php","line":95,"function":"dispatch","class":"Magento\\Framework\\Event\\Manager","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/App/Cron.php","line":86,"function":"dispatch","class":"Magento\\Framework\\Event\\Manager\\Proxy","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/module-cron/Console/Command/CronCommand.php","line":126,"function":"launch","class":"Magento\\Framework\\App\\Cron","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/symfony/console/Command/Command.php","line":298,"function":"execute","class":"Magento\\Cron\\Console\\Command\\CronCommand","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Interception/Interceptor.php","line":58,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Interception/Interceptor.php","line":138,"function":"___callParent","class":"Magento\\Cron\\Console\\Command\\CronCommand\\Interceptor","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Interception/Interceptor.php","line":153,"function":"Magento\\Framework\\Interception\\{closure}","class":"Magento\\Cron\\Console\\Command\\CronCommand\\Interceptor","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/generated/code/Magento/Cron/Console/Command/CronCommand/Interceptor.php","line":23,"function":"___callPlugins","class":"Magento\\Cron\\Console\\Command\\CronCommand\\Interceptor","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/symfony/console/Application.php","line":1040,"function":"run","class":"Magento\\Cron\\Console\\Command\\CronCommand\\Interceptor","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/symfony/console/Application.php","line":301,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/magento/framework/Console/Cli.php","line":116,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/vendor/symfony/console/Application.php","line":171,"function":"doRun","class":"Magento\\Framework\\Console\\Cli","type":"->"},{"file":"/var/www/vhosts/magento2/httpdocs/bin/magento","line":23,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"}] []

Thanks for any help.

2 Answers 2

0
  • Check for special characters or entities in the XML content added using the addChild() method and ensure they are properly escaped.

  • Validate the XML structure to ensure all tags are properly balanced
    and any attributes are correctly formatted.

  • Verify the data being used to generate the XML is clean and does not contain unescaped special characters or entities.

0

Use htmlspecialchars in secod parameter like below

$xml->addChild($key,htmlspecialchars($value)); 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.