chart title not escaped properly

UI Components for JSF
Post Reply
dangkhoa
Posts: 1
Joined: 22 Sep 2017, 15:47

22 Sep 2017, 15:52

Hello,

I don't know if this is a bug, but chart title is not escaped properly, i.e.:
CODE: SELECT ALL
<p:barChart id="chart" title="#{chartBean.chartName}" stacked="true" value="#{chartBean.chartModel}" extender="extender" widgetVar="chart" style="height: 300px;" />
And if the chartBean.chartName is "John's chart" or even better "Hello world <iframe src=... />" in the first case the chart is not rendered (syntax error because of single quote) and in the second iframe is displayed instead of title... I was pretty surprised when I discovered this, so I think it should be either mentioned somewhere in the documentation or filed as a bug.

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

23 Sep 2017, 14:30

What version of PrimeFaces are you using? I have fixed a bunch of escaping issues in the chart for PF 6.1 before but its possible I missed one.

https://github.com/primefaces/primefaces/issues/709

And from looking at the code the title is escaped...

https://github.com/primefaces/primeface ... r.java#L45
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Majestic-12 [Bot] and 28 guests