Re: [phpslash-users] html in comments
Brought to you by:
joestewart,
nhruby
From: Ajay S. <ss...@od...> - 2001-05-15 03:33:20
|
I had this problem too. To fix it on line 494, there's an $ary = clean($ary); change it to: $ary = clean($ary,true); The 'true' sets the $allow_html variable. When that is set to true then the htmlentities doesn't run on the text. Crap! That code isn't in the CVS yet. I promise I'll check it in soon!! Here's a copy of my clean function: /****************************************************************************** function : clean -> removes nasty things that hurt databases Parameters : $dirty -> string or array to clean up $allow_html -> if true, then we don't convert HTML characters like < and > into > and < *******************************************************************************/ function clean ($dirty,$allow_html=false) { if (is_array($dirty)) { while( list( $key, $val) = @each( $dirty )) { if ($allow_html) { $clean[$key] = str_replace("'","'",(stripslashes($val))); } else { $clean[$key] = str_replace("'","'",(htmlspecialchars(stripslashes($val)))); } } } else { if ($allow_html) { $clean = str_replace("'","'",(stripslashes($dirty))); } else { $clean = str_replace("'","'",(htmlspecialchars(stripslashes($dirty)))); } } return $clean; } later, ajay On Mon, 14 May 2001, Mike Gifford wrote: > Hello, > > I've just downloaded the latest CVS, hoping that it might contain the answers to > my problem, but was not in luck. > > There is the option within the comments to insert html or text, but it appears > that only the text is working: > http://octopusbooks.ca/discuss/article.php3?story_id=79 > > Any suggestion why this wouldn't be working? > > Thanks. > > Mike > -- ---------------------------------------------------------------- Satyajot (Ajay) Sharma ss...@od... Digital Odyssey System Administrator Those who can, do. Those who can't, get their MCSE. ---------------------------------------------------------------- |