Skip to content

Fix: formatted text rendered as visible HTML tags in PDF exports#69

Draft
Rom1-B wants to merge 1 commit into
10.0/bugfixesfrom
support_43955
Draft

Fix: formatted text rendered as visible HTML tags in PDF exports#69
Rom1-B wants to merge 1 commit into
10.0/bugfixesfrom
support_43955

Conversation

@Rom1-B
Copy link
Copy Markdown

@Rom1-B Rom1-B commented May 28, 2026

Checklist before requesting a review

Please delete options that are not relevant.

  • I have performed a self-review of my code.
  • I have added tests (when available) that prove my fix is effective or that my feature works.
  • I have updated the CHANGELOG with a short functional description of the fix or new feature.
  • This change requires a documentation update.

Description

  • It fixes !43955

GLPI-encoded content (&#60;p&#62;) was concatenated with the HTML label before getEnhancedHtml() processing in displayText(). The mixed string caused Sanitizer::isHtmlEncoded() to return false (literal <> in the label), skipping entity decoding. TCPDF then rendered &#60;p&#62; as visible text characters <p> instead of HTML paragraph tags, producing HTML fragments in the PDF and all text as a single unformatted block.

Fix: process $content separately through getEnhancedHtml() before concatenating with the label. Also strips residual <script> tags to prevent JavaScript code (e.g., from GLPI's "read more" wrapper) from appearing as visible text in the PDF.

Screenshots (if appropriate):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant