Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-24562

Twig's path() / ez_urlalias() breaks on urls with special chars

    XMLWordPrintable

    Details

      Description

      In Twig templates, the path( location ) function is not escaping special characters.

      If legacy's urlalias_iri transformation mode is used, and content created with quotes, for example, it will break links generated through symfony / twig templates.

      Steps to reproduce:
      1. in ezpublish_legacy/settings/override/site.ini.append.php, add
        [URLTranslator]
        TransformationGroup=urlalias_iri
        
      2. Create a content with special chars, such as Test " Article <>
      3. Create or use template to view this content, for example:
        <a id="test" href="{{ path( location ) }}">
          {{ ez_render_field( content, 'title' ) }}
        </a>
        
      4. Verify the link is broken.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            joao.inacio-obsolete@ez.no Joao Inacio (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m