Re: [PHP] Close all open tags in HTML text

2004-12-13 Thread Richard Lynch
Matt Palermo wrote: I realize that I can use the strip_tags function to remove HTML. But I don't want to remove HTML tags. I just want to make sure all open HTML tags are closed. For example if they user submits HTML with a table tag and never closes it, then the rest of the page will look

Re: [PHP] Close all open tags in HTML text

2004-12-13 Thread Don Read
On 09-Dec-2004 Marek Kilimajer wrote: snipage not really, but it removes script and /script so javascript is not interpreted. $txt = preg_replace('|script[^]*?.*?/script|si', '', $txt); Regards, -- Don Read [EMAIL PROTECTED] -- It's always darkest

Re: [PHP] Close all open tags in HTML text

2004-12-12 Thread Daniel Schierbeck
Matt Palermo wrote: I realize that I can use the strip_tags function to remove HTML. But I don't want to remove HTML tags. I just want to make sure all open HTML tags are closed. For example if they user submits HTML with a table tag and never closes it, then the rest of the page will look

Re: [PHP] Close all open tags in HTML text

2004-12-10 Thread Richard Lynch
Matt Palermo wrote: I would like to leave any HTML in there, Do you *TRUST* the people typing the HTML to not attack your server, or others, with cross-site scripting attacks? If not, go re-read the manual about strip_tags, and pay particular attention to the second, optional, argument. but

Re: Re: [PHP] Close all open tags in HTML text

2004-12-10 Thread John Holmes
From: Richard Lynch [EMAIL PROTECTED] Matt Palermo wrote: but just make sure that ending tags exist, so it doesn't screw up the rest of the page. Strip tags would just wipe out the HTML rather than allowing it and ending it safely. Strip tags will allow you to wipe out *DANGEROUS*

Re: [PHP] Close all open tags in HTML text

2004-12-10 Thread Matt Palermo
I realize that I can use the strip_tags function to remove HTML. But I don't want to remove HTML tags. I just want to make sure all open HTML tags are closed. For example if they user submits HTML with a table tag and never closes it, then the rest of the page will look screwed up. I still

Re: Re: [PHP] Close all open tags in HTML text

2004-12-10 Thread Greg Donald
On Fri, 10 Dec 2004 17:38:13 -0500, John Holmes [EMAIL PROTECTED] wrote: strip_tags() is a rather worthless function, if you ask me. strip_tags() is pretty handy when scraping another site. Like the other day I was asked to grab some links off a site where there was no RSS feed available.. I

Re: [PHP] Close all open tags in HTML text

2004-12-09 Thread Robin Vickery
On Wed, 8 Dec 2004 22:33:19 -0500, Matt Palermo [EMAIL PROTECTED] wrote: I am allowing users to imput HTML code into a textarea. After they input this, I wany to output their HTML to the browser. In order for the document to be safe, I need to close all open HTML tags that have been left open

Re: [PHP] Close all open tags in HTML text

2004-12-09 Thread Richard Lynch
Matt Palermo wrote: I am allowing users to imput HTML code into a textarea. After they input this, I wany to output their HTML to the browser. In order for the document to be safe, I need to close all open HTML tags that have been left open by the user, along with any open comments. Is

Re: [PHP] Close all open tags in HTML text

2004-12-09 Thread Marek Kilimajer
Richard Lynch wrote: Matt Palermo wrote: I am allowing users to imput HTML code into a textarea. After they input this, I wany to output their HTML to the browser. In order for the document to be safe, I need to close all open HTML tags that have been left open by the user, along with any open

Re: [PHP] Close all open tags in HTML text

2004-12-09 Thread Matt Palermo
I would like to leave any HTML in there, but just make sure that ending tags exist, so it doesn't screw up the rest of the page. Strip tags would just wipe out the HTML rather than allowing it and ending it safely. Richard Lynch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]

[PHP] Close all open tags in HTML text

2004-12-08 Thread Matt Palermo
I am allowing users to imput HTML code into a textarea. After they input this, I wany to output their HTML to the browser. In order for the document to be safe, I need to close all open HTML tags that have been left open by the user, along with any open comments. Is there a way to take an

Re: [PHP] Close all open tags in HTML text

2004-12-08 Thread Raditha Dissanayake
Matt Palermo wrote: I am allowing users to imput HTML code into a textarea. After they input this, I wany to output their HTML to the browser. In order for the document to be safe, I need to close all open HTML tags that have been left open by the user, along with any open comments. Is there

: [PHP] Close all open tags in HTML text

2004-12-08 Thread yangshiqi
May be you could use a iframe to ensure your own page much safer, despite show the users' inputs is very dangerous. -- : Raditha Dissanayake [mailto:[EMAIL PROTECTED] : 2004129 12:26 : [EMAIL PROTECTED] : Re: [PHP] Close all open tags in HTML text Matt Palermo wrote: I am allowing