• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problems with cfdocument and getSafeHTML()

Explorer ,
Jul 31, 2018 Jul 31, 2018

Copy link to clipboard

Copied

I have a site where users can fill out reports.  The admins have the ability to control the questions.  So, I'm using GetSafeHTML() when I show the questions because there are some questions that have bulletted lists and EncodeForHTML when displaying the answers.  That all works fine when displaying the questions and answers to the screen.  However, the user also has the option to save the report as a pdf.  I'm using cfdocument to create the pdf.  My problem is that anything with GetSafeHTML is showing the html (ie <ul><li>, etc.) for the list instead of just displaying the bulleted list.

Anyone else having similar problems?  Any thoughts on work arounds?  I am thinking of using IsSafeHTML and only displaying if it is safe and no longer using GetSafeHTML to display.  Anyone deal with this differently?

Views

389

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 31, 2018 Jul 31, 2018

Have you tried putting the content within canonicalize()?  Have you tried using CFPDF?

V/r,

^ _ ^

Votes

Translate

Translate
LEGEND ,
Jul 31, 2018 Jul 31, 2018

Copy link to clipboard

Copied

Have you tried putting the content within canonicalize()?  Have you tried using CFPDF?

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 31, 2018 Jul 31, 2018

Copy link to clipboard

Copied

Turned out to be a versioning problem...

The site is running on CF11 and I'm developing on CF2016, which is what they are moving to next month.

On CF11, getSafeHTML() doesn't work with cfdocument/pdf.  Canonicalize() does work on both cf11 and cf2016 when outputting html, so that's what I'm using in this case.  On CF2016, getSafeHTML() works fine with cfdocument/pdf.

I didn't try cfpdf. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 31, 2018 Jul 31, 2018

Copy link to clipboard

Copied

LATEST

Glad you got it working.  And thank you for marking my answer correct.  I do appreciate it.

V/r,

^ _ ^

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation