Development

#3792 (i18n XLIFF do not handle entities correctly)

You must first sign up to be able to contribute.

Ticket #3792 (closed defect: fixed)

Opened 7 months ago

Last modified 7 months ago

i18n XLIFF do not handle entities correctly

Reported by: Eric.Lemoine Assigned to: fabien
Priority: major Milestone: 1.0.17
Component: i18n Version: 1.0.16
Keywords: i18n xliff entities Cc:
Qualification: Ready for core team

Description

When a message contains some special characters like & or < or > it is not saved correctly by the save method of sfMessageSource_XLIFF class.

Indeed the save method use createElement with the second argument as the value of the node. This way the value is not escaped correctly (see the following comment on the PHP manual page for createElement method). So either you handle the escaping by applying htmlentities to the value within the createElement method (but it is the wrong way to correct it), either you make use of the createTextNode method for the value.

I have made patches for both symfony 1.0 and symfony 1.1 branches which correct this bug, using createTextNode method. Indeed the same bug applies to the latest RC for the symfony 1.1 branch.

Eric

Attachments

symfony_1.0_i18n_XLIFF.diff (1.4 kB) - added by Eric.Lemoine on 06/20/08 10:58:00.
Patch for symfony 1.0 branch
symfony_1.1_i18n_XLIFF.diff (1.4 kB) - added by Eric.Lemoine on 06/20/08 10:58:52.
Patch for symfony 1.1 branch

Change History

06/20/08 10:58:00 changed by Eric.Lemoine

  • attachment symfony_1.0_i18n_XLIFF.diff added.

Patch for symfony 1.0 branch

06/20/08 10:58:52 changed by Eric.Lemoine

  • attachment symfony_1.1_i18n_XLIFF.diff added.

Patch for symfony 1.1 branch

06/23/08 07:28:39 changed by dwhittle

  • qualification changed from Unreviewed to Ready for core team.
  • milestone set to 1.1.0 FINAL.

This is implemented in dwhittle branch in r9776

06/23/08 17:32:10 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.

(In [9805]) fixed i18n XLIFF do not handle entities correctly (closes #3792 - patch from Eric.Lemoine)

06/23/08 17:33:05 changed by fabien

(In [9806]) fixed i18n XLIFF do not handle entities correctly (closes #3792 - patch from Eric.Lemoine)

06/23/08 17:36:17 changed by fabien

  • milestone changed from 1.1.0 FINAL to 1.0.17.