1

Topic: Help configuring

Hi!

I'm having some problems configuring htmlLawed. I want it to remove script tags, but I can't seem to be able to do that. I believe this is the correct sintax, right?

   include 'htmLawed.php';
   $htmlText = "<script>alert('Something is wrong');</script>";
   $config = array('elements'=>'*-script');
   $htmlText = htmLawed($htmlText, $config);

Maybe that's not the way to do it? Any help is great. Thanks! :)

2

Re: Help configuring

Yes, that is the correct syntax and the output should be:

&lt;script&gt;alert('Something is wrong');&lt;/script&gt;

(If $config['keep_bad'] is set to 0, the output will be alert('Something is wrong');. You can test various config values using the settings option on the demo page.)

What output are you getting?

3

Re: Help configuring

Thanks! I figure it out. I wasn't stripslashing the HTML. Guess I have to pay more attention to the docs! :D