Javascript in content body

In this board you can talk about general questions about phpMyFAQ

Moderator: Thorsten

Post Reply
jaytoox
Posts: 5
Joined: Tue Apr 18, 2006 6:58 pm

Javascript in content body

Post by jaytoox »

I briefly searched this forum for the answer I am looking for with no luck.

How can I enable my phpmyfaq to not filter javascrpt I put in the content?

I have an image, and would like to insert javascript so it pops out in a new window at the correct size.

Thanks,

Joshua
Thorsten
Posts: 15727
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

just remove the JavaScript filter in the file inc/init.php in the method PMF_Init::cleanRequest().

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
remuze
Posts: 12
Joined: Tue Oct 03, 2006 2:49 pm

Post by remuze »

I can't find PMF_Init::cleanRequest in init.php

I'm using version 1.6.5
matteo
Posts: 572
Joined: Sun Nov 20, 2005 6:53 pm
Location: Italy

Post by matteo »

Hi,
maybe you've been badly driven by the OOP syntax ;) that means:
- class PMF_Init
- method cleanRequest
So you'll find it declared as:

Code: Select all

function cleanRequest()
within the :

Code: Select all

class PMF_Init
You need to move this line from:

Code: Select all

				$newvalues = PMF_Init::removeXSSGPC($newvalues);
to:

Code: Select all

				//$newvalues = PMF_Init::removeXSSGPC($newvalues);
Beware that this simple change will expose you to XSS attacks. It would be wiser to customize a little bit the basicXSSClean function to avoid the cleaning of your desired tags.

Regards,
Matteo
phpMyFAQ QA / Developer
Amazon.co.uk Wishlist
remuze
Posts: 12
Joined: Tue Oct 03, 2006 2:49 pm

Post by remuze »

Very good answer for me, a beginner.
:D Thanx
remuze
Posts: 12
Joined: Tue Oct 03, 2006 2:49 pm

Post by remuze »

Is this still the same method in version 2.0.1 ?
Thorsten
Posts: 15727
Joined: Tue Sep 25, 2001 11:14 am
Location: #phpmyfaq
Contact:

Post by Thorsten »

Hi,

yes.

bye
Thorsten
phpMyFAQ Maintainer and Lead Developer
amazon.de Wishlist
Post Reply