By using something like
$var = preg_replace(
"!<(i|b|small|big|code)>(.+)\\1>!isU",
"<\\1>\\2", $var);
you can accomplish a solution where only closed tags
will be reconverted.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Thu, 2007-02-08 at 15:32 -0700, Don wrote:
> > I asked this question awhile ago and never really visited the issue till
> > now. The response I got showed me how to disable everything, but I want to
> > allow basic html tags.
>
>
> http://us3.php.net/strip_tags
>
> You can use the optional se
> I asked this question awhile ago and never really visited the issue till
> now. The response I got showed me how to disable everything, but I want to
> allow basic html tags.
http://us3.php.net/strip_tags
You can use the optional second parameter to specify tags which should not
be stripped.
It's more secure to begin with converting the string using
htmlentities() and reconverting allowed tags afterwards.
See
http://alistapart.com/articles/secureyourcode
http://alistapart.com/articles/secureyourcode2
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://ww
> -Original Message-
> From: Don [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 08, 2007 3:28 PM
> To: php-general@lists.php.net
> Subject: RE: [PHP] what do i need to disable
>
>
> I asked this question awhile ago and never really visited the issue till
&
I asked this question awhile ago and never really visited the issue till
now. The response I got showed me how to disable everything, but I want to
allow basic html tags.
~My original question~
My next task is disable harmful tags/scripts in a full text field.
I want to store a bio type field
I asked this question awhile ago and never really visited the issue till
now. The response I got showed me how to disable everything, but I want to
allow basic html tags.
~My original question~
My next task is disable harmful tags/scripts in a full text field.
I want to store a bio type field a
Check this out :
http://www.weberdev.com/get_example-4473.html
berber
-Original Message-
From: Don [mailto:[EMAIL PROTECTED]
Sent: Friday, January 19, 2007 7:38 AM
To: php-general@lists.php.net
Subject: [PHP] what do i need to disable
Ok,
You have been very helpful with my questi
8 matches
Mail list logo