Initial commit
This commit is contained in:
21
func_htmlclean.php
Normal file
21
func_htmlclean.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?PHP
|
||||
ignore_user_abort(true); // DAMIT DAS SCRIPT AUF KEINEN TIMEOUT LÄUFT
|
||||
@set_time_limit(0);
|
||||
|
||||
function htmlclean($html, $db) {
|
||||
$html= preg_replace('/<(\/)?(font|span|del|ins|style)[^>]*>/','',$html);
|
||||
$html= preg_replace('/<([^>]*)(class|lang|size|face)=("[^\"]*"|\'[^\']*\'|[^>]+)([^>]*)>/','',$html);
|
||||
$html= preg_replace('/<([^>]*)(class|lang|size|face)=("[^\"]*"|\'[^\']*\'|[^>]+)([^>]*)>/','',$html);
|
||||
$html= preg_replace('/<meta(.|\s)*?>/', '', $html);
|
||||
$html= preg_replace('/<\/meta(.|\s)*?>/', '', $html);
|
||||
$html= preg_replace('/<link(.|\s)*?>/', '', $html);
|
||||
$html= preg_replace('/<!--.+?-->/s', '', $html);
|
||||
$html= preg_replace('/\s{2,}/sm',' ',$html,PREG_SET_ORDER); //Mehr als zwei leerzeichen entfernen
|
||||
$html= preg_replace('/\s{2,}/sm',' ',$html,PREG_SET_ORDER); //Mehr als zwei leerzeichen entfernen
|
||||
$html= str_replace (array("\r\n"), array(""), $html);
|
||||
$html= trim($html);
|
||||
$html= $db->real_escape_string(stripslashes($html));
|
||||
return $html;
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user