Textarea encoding issue in Symphony
- 10th January 2011
In my last blog post I was writing about an HTML issue in Drupal, and I “quoted” a few words in my post. When previewing the post, I was surprised to see that my quotes were appearing as "Quoted Text". As a web developer I’m used to seeing encoded HTML entities, but after trying various ways of encoding and escaping the speech marks, I’d still not fixed the problem.
I spent some time going through the markdown.php file in the Markdown extension folder in Symphony, but everything looked as it should. The Symphony debug page showed up something interesting - it looked as if the text were being encoded twice. For example, rather than the XML containing:
<p>I "quoted" a few words</p>
instead it contained:
<p>I &quot;quoted&quot; a few words</p>
So in /symphony/lib/toolkit/fields/field.textarea.php I commented out line 146 to correct the problem.
// $result = $this->__replaceAmpersands($result);
This appeared to fix the problem entirely. Although I’ve spent a lot of time testing, there could still be side effects with commenting out this line. I’ll update this post if anything bad happens!