Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function filter_param($text,$html=true){
- $e_s=array('\\','\'','"');
- $d_s=array('','','');
- $text = preg_replace( "'<script[^>]*>.*?</script>'si", '', $text );
- $text = preg_replace( '/<a\s+.*?href="([^"]+)"[^>]*>([^<]+)<\/a>/is', '\2 (\1)', $text );
- $text = preg_replace( '/<!--.+?-->/', '', $text );
- $text = preg_replace( '/{.+?}/', '', $text );
- $text = preg_replace( '/ /', ' ', $text );
- $text = preg_replace( '/&/', '', $text );
- $text = str_replace( $e_s, $d_s, $text );
- $text = strip_tags( $text );
- $text = preg_replace("/\r\n\r\n\r\n+/", " ", $text);
- $text = $html ? htmlspecialchars( $text ) : $text;
- return $text;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement