<p>The has been solved (kinda) - turns out CSS was being passed into the <code>renderObjectTemplate</code> method for an email template. This meant that Twig was (understandably) trying to process the <code>{</code> and <code>}</code> characters as objects which was causing the service to throw a wobble. </p>

<p>Have stripped out the CSS for now and will see if there is another way we can pass these characters into the service without breaking it.</p>

<p>Many thanks @robin on the CraftCMS Slack for help identifying and debugging the problem.</p>

CC BY-SA 4.0
2018-08-23T09:05:06.560Z
2018-08-23T09:05:06.560Z
Cole Henley
<p>Having a problem with the Formerly plugin where it is throwing an error if CSS is passed into the Submission body. Not sure if this is a Craft of a Formerly problem but looking into it further, the issue seems to occur when <code>!</code> or <code>;</code> are being passed into the <code>templates-&gt;renderObjectTemplate()</code> service - this results in an <code>Unexpected character</code> error being returned. </p>

<p>Any thoughts on how best to sanitise the input for this method so that form submission doesn't break?</p>

<plugin-development><plugins-formerly>
Special characters in `template->renderObjectTemplate` method
# Special characters in `template->renderObjectTemplate` method

(Asked by: username_0 on 2018-08-21)

Having a problem with the Formerly plugin where it is throwing an error if CSS is passed into the Submission body. Not sure if this is a Craft of a Formerly problem but looking into it further, the issue seems to occur when `!` or `;` are being passed into the `templates->renderObjectTemplate()` service - this results in an `Unexpected character` error being returned.

Any thoughts on how best to sanitise the input for this method so that form submission doesn't break?

**Tags:** plugin-development, plugins-formerly


---

## 1 answers

### Answer by username_0 on 2018-08-23. Score: 1

The has been solved (kinda) - turns out CSS was being passed into the `renderObjectTemplate` method for an email template. This meant that Twig was (understandably) trying to process the `{` and `}` characters as objects which was causing the service to throw a wobble.

Have stripped out the CSS for now and will see if there is another way we can pass these characters into the service without breaking it.

Many thanks @robin on the CraftCMS Slack for help identifying and debugging the problem.


---

