Search

Hi,

I have a client using Symphony 2.1.2 who was inputting passport details into an unformatted textarea, which contained a string like "<<<<<<<MORRISH".

This was output in the XML and being interpreted as an XML element - an XSLT processing error was generated: "error parsing attribute name".

I fixed this by modifying the core in field.textarea.php by adding:

$value = strreplace('<', '<', $value); $value = strreplace('>', '>', $value);

under the __replaceAmpersands function call in "appendFormattedElement". I'm sure there's a nicer way to do this using regex!

I'm not sure if this is an issue in 2.2.1, but the code for appendFormattedElement looks identical in both versions.

Can this be added to the next Symphony release?

I've just noticed that in my above comment the strreplace parameters have been altered.

The second param should be "& lt ;" (without the spaces).

Since this forum runs on Symphony, I guess it has been fixed in the latest version?!

Are you using a Text Formatter?

Hi,

No text formatter involved...

you could try to translate the char into the entity format ...

Using a Text Formatter does the magic escaping for you :) These forums use Markdown, which does the job of translating special characters into entities so they don't display oddly on the frontend.

Give it a shot (keep in mind you have to resave the entry once a Text Formatter has been applied for it to take effect. You'll also need to check your Datasource to make sure it's selecting the 'field-handle: formatted' version

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details