[Comoblog-commit] comoblog/modules/mod_search/include blog_search.inc.php,1.1,1.2
Status: Inactive
Brought to you by:
markwallis
|
From: Mark W. \(a. serialmonkey\) <mar...@us...> - 2005-10-05 01:38:45
|
Update of /cvsroot/comoblog/comoblog/modules/mod_search/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25544/modules/mod_search/include Modified Files: blog_search.inc.php Log Message: Move filter_html code into core library Index: blog_search.inc.php =================================================================== RCS file: /cvsroot/comoblog/comoblog/modules/mod_search/include/blog_search.inc.php,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- blog_search.inc.php 5 Oct 2005 00:48:15 -0000 1.1 +++ blog_search.inc.php 5 Oct 2005 01:38:32 -0000 1.2 @@ -83,40 +83,6 @@ } -function filter_html($body) -{ - $search = array ("'<script[^>]*?>.*?</script>'si", // Strip out javascript - "'<[\/\!]*?[^<>]*?>'si", // Strip out HTML tags - "'([\r\n])[\s]+'", // Strip out white space - "'&(quot|#34);'i", // Replace HTML entities - "'&(amp|#38);'i", - "'&(lt|#60);'i", - "'&(gt|#62);'i", - "'&(nbsp|#160);'i", - "'&(iexcl|#161);'i", - "'&(cent|#162);'i", - "'&(pound|#163);'i", - "'&(copy|#169);'i", - "'&#(\d+);'e"); // evaluate as php - - $replace = array ("", - "", - " ", - "\"", - "&", - "<", - ">", - " ", - chr(161), - chr(162), - chr(163), - chr(169), - "chr(\\1)"); - - $body = preg_replace($search, $replace, $body); - return $body; -} - function filter_punc($body) { $search = "/(,|\.|<|>|\?|\/|;|:|\"|'|{|}|\[|\]|\\\|\||=|-|_|\+|\(|\)|\*|&|\^|%|\\$|#|@|!|~|`)/"; |