note 100393 added to function.htmlentities

From: Date: Wed, 13 Oct 2010 06:30:21 +0000
Subject: note 100393 added to function.htmlentities
Groups: php.notes 
Request: Send a blank email to php-notes+get-173181@lists.php.net to get a copy of this message
re: yet again my previous post: there is a major functional bug in the last "if" statement, just before the call to htmlentities(), within the tag handling section. There should be no test for $nl_to_br. The line should read: <?php if (($x=strpos($sS, "pre"))!==FALSE and $x<2) $PREflag=(boolean)$x; ?> without this change, spaces will still be "collapsed" inside 'pre' '/pre' tags. An earlier version has been in use for a year, and this one was tested for (ahem, cough, cough) several hours... Oh my face is so red! And I forgot to mention the last option, $skip_Quotes, is mainly for internal use, but you may also use it; note that it affects the spaces/tabs "toXHTML" . The three arrays of data ($HTML_ENTS, $HTML_TAGS, and $Xchars) may be included in the function body, or used "globally". If you use the function once per inclusion, put them in the body and let them go through garbage collection automatically. If you use it a few times, make them global, then unset them to free up memory for later heavy duty jobs. If you use it several times, or with text containing a lot of HTML tags, consider making them static inside the function to save time defining them, while containing them, especially as this function CALLS ITSELF on each tag, and they are big arrays. ---- Server IP: 69.147.83.197 Probable Submitter: 74.160.133.170 ---- Manual Page -- http://www.php.net/manual/en/function.htmlentities.php Edit -- https://master.php.net/note/edit/100393 Del: integrated -- https://master.php.net/note/delete/100393/integrated Del: useless -- https://master.php.net/note/delete/100393/useless Del: bad code -- https://master.php.net/note/delete/100393/bad+code Del: spam -- https://master.php.net/note/delete/100393/spam Del: non-english -- https://master.php.net/note/delete/100393/non-english Del: in docs -- https://master.php.net/note/delete/100393/in+docs Del: other reasons-- https://master.php.net/note/delete/100393 Reject -- https://master.php.net/note/reject/100393 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#173181) next »