Add FAQ with WYSIYG

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
innoforce
Posts: 8
Joined: Wed Oct 06, 2010 2:10 pm

Add FAQ with WYSIYG

Post by innoforce »

Add FAQ with WYSIYG in the Home-Site not just in the "Backend-Page".
I have seen that some of you have that problem and solved it.
But how did you solved that problem??


Thank you in advance.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Add FAQ with WYSIYG

Post by Thorsten »

Hi,

I think some users added TinyMCE into the add.tpl page. It's just a little bit of JavaScript.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
WillardVOQ
Posts: 1
Joined: Mon Oct 25, 2010 7:34 pm

Re: Add FAQ with WYSIYG

Post by WillardVOQ »

Just tried activating TinyMCE in add.tpl.

It works, the toolbars and everything shows up at the textarea "content", but formatting gets stripped off when submitted. For example, line breaks become "nbsp;" when the submitted added content is subsequently viewed by Admin.

Two questions:

1. Does the rich text sanitation happen on submission or on output in this case?
2. Is there a way to preserve rich formatting of submitted areas if TinyMCE is enabled via add.tpl?

Thanks.
Thorsten
Posts: 15725
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Re: Add FAQ with WYSIYG

Post by Thorsten »

Hi,

you have to change the line 42 in save.php from

Code: Select all

$content     = PMF_Filter::filterInput(INPUT_POST, 'content', FILTER_SANITIZE_STRIPPED);
to

Code: Select all

$content     = PMF_Filter::filterInput(INPUT_POST, 'content', FILTER_SANITIZE_STRING);
Please note, that then XSS attacks are possible.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
tshrinivasan
Posts: 5
Joined: Wed Dec 01, 2010 6:11 pm

Re: Add FAQ with WYSIYG

Post by tshrinivasan »

Post Reply