Update of /cvsroot/php-blog/serendipity
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24084
Modified Files:
serendipity_functions.inc.php
Log Message:
make arrays static, remove <p>-Handling, add hr-handling
Index: serendipity_functions.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/serendipity_functions.inc.php,v
retrieving revision 1.240
retrieving revision 1.241
diff -u -d -r1.240 -r1.241
--- serendipity_functions.inc.php 25 Mar 2004 22:13:16 -0000 1.240
+++ serendipity_functions.inc.php 26 Mar 2004 13:21:55 -0000 1.241
@@ -1360,19 +1360,19 @@
// TODO:
// check ALL ampersands, find out if it's a valid code, and encode if not
function xhtml_cleanup($html) {
- $p = array("/\&([\s\<])/", // ampersand followed by whitespace or tag
- "/\&$/", // ampersand at end of body
- "/<br([^\/]*)>/i", // unclosed br tag - attributes included
- "/<p([^\/]*)>/i", // any unclosed p tag
- "/<\/p>/i" // closing </p> tags, dropped for feed
+ static $p = array(
+ '/\&([\s\<])/', // ampersand followed by whitespace or tag
+ '/\&$/', // ampersand at end of body
+ '/<(b|h)r([^\/>]*)>/i', // unclosed br tag - attributes included
);
- $r = array("&\\1",
- "&",
- "<br\\1 />",
- "<p\\1 />",
- ""
+
+ static $r = array(
+ '&\1',
+ '&',
+ '<\1r\2 />'
);
- return preg_replace($p,$r,$html);
+
+ return preg_replace($p, $r, $html);
}
function serendipity_printEntries_rss($entries, $version, $comments = false) {
|