- $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