Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 985
    • Issues 985
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • Core
  • Issues
  • #2413

Closed
Open
Opened Feb 23, 2021 by Lunar@lunar

Invalid ODT generated when tokens contain XML reserved symbols

Overview

The Print/Merge feature creates broken ODT file using an ODT template with tokens if the data contains an ampersand (&). The & character gets written directly to the content.xml, therefore creating invalid XML, and therefore an invalid ODT.

Reproduction steps

  1. Create a contact with Test & Test in Adressee.
  2. Create an ODT template containing {contact.addressee}.
  3. Open the Print/Merge activity on the previously created contact.
  4. Select the previously created ODT as template.
  5. Perform the merge.

Current behaviour

The resulting ODT file is broken.

Expected behaviour

A valid ODT file should be generated (eg. reserved XML symbols should be properly escaped).

Environment information

  • CiviCRM: 5.34.0
  • PHP: 7.3
  • CMS: Drupal 9.1
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#2413