-
Type:
Bug
-
Resolution: Fixed
-
None
-
Affects Version/s: None
-
Component/s: None
-
Emptyshow more show less
We assume a CSV project with a segment containing the following characters:
{{ & }}
For CSV files the ampersand will not be encoded internally to a HTML entity.
After editing the segment, the ampersand is encoded to an entity by the browser. This is then stored in the DB. Since CSV export does also no decoding of HTML entities at all, the & is exported as HTML entity instead as a plain char. If this happens with all browsers is not clear.
Todos out of this error:
- Fix the en- and decoding for CSV files
- create a dedicated test, which contains a sample import file, with a short test file of every supported type containing special characters. Import this file, edit segments, and export them, and check for the result.
In addition the unencoded entity leads to the following error on saving the segment: "No valid HTML in translate5 segment".
Produced by libXML on parsing:
{{LibXMLError Object
(
[level] => 2
[code] => 68
[column] => 65
[message] => htmlParseEntityRef: no name
[file] =>
[line] => 1
)}}
This all happens in editor_Models_Segment::stripTermTags.
- relates to
-
TRANSLATE-379 Entering HTML entities and tags in editor leads to strange behavior
- Done
-
TRANSLATE-654 Improve tag protection and regex-based protection in CSV files
- Done