Re: cvs: phpweb /include layout.inc
| From: | Andrew Lindeman | Date: | Sun, 04 May 2003 16:11:22 +0000 |
| Subject: | Re: cvs: phpweb /include layout.inc | ||
| References: | 1 2 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-17307@lists.php.net to get a copy of this message | ||
On Sun, 2003-05-04 at 11:10, Gabor Hojtsy wrote:
> > - $fixes = array('<br>','<p>','</p>');
> > + $fixes = array('<br>', '</p>');
> > reset($fixes);
> > while (list(,$f)=each($fixes)) {
> > $text=str_replace(htmlspecialchars($f), $f, $text);
> > $text=str_replace(htmlspecialchars(strtoupper($f)), $f, $text);
> > }
> >
> > - /* Make sure <p> tags stay in the CSS "note" class*/
> > - $text = str_replace (array ('<P>', '<p>'),
> > '<p class="note">', $text);
> > + /* <p> tags make things look awfully weird (breaks things out of the
> > <code>
> > + tag). Just convert them to <br>'s
> > + */
> > + $text = str_replace (array ('<P>', '<p>'),
> > '<br>', $text);
> > +
> > + /* Remove </p> tags to prevent it from showing up in the note */
> > + $text = str_replace (array ('</P>', '</p>'),
> > '', $text);
>
> Well, I don't really see now what is the real input of here in $text,
> but if it is a text htmlspecialchar()ed, then as you removed the <p> fix
> from the top, there will be no <p> found by the str_replace() part. Only
> <p> will exist. Also this is the same for <P> which does not seem
> to be worhty to put to your str_replace(), as it will probably not
> found, as the whole $text seems to be htmlspecialchar()ed.
>
> I have not digged into this right now, just assumed that $text went
> through htmlspecialchars().
>
> Goba
Yes, I forgot to replace that while I was trying to come up with a good
solution. I've replaced it. Thanks
--Andrew