Censorship.php
changeset 2 c8e6db42385f
parent 1 bfc5494ee70c
child 3 28a899aa460e
equal deleted inserted replaced
1:bfc5494ee70c 2:c8e6db42385f
    21 	
    21 	
    22 	// save HTML tags
    22 	// save HTML tags
    23 	$text = preg_split('/(<(?:[a-z\/].+?|!--.+?--)>|<script[^>]*>[\w\W]*?<\/script>)/', $text, NULL, PREG_SPLIT_DELIM_CAPTURE);
    23 	$text = preg_split('/(<(?:[a-z\/].+?|!--.+?--)>|<script[^>]*>[\w\W]*?<\/script>)/', $text, NULL, PREG_SPLIT_DELIM_CAPTURE);
    24 	foreach ( $text as &$block )
    24 	foreach ( $text as &$block )
    25 	{
    25 	{
       
    26 		if ( strlen($block) < 1 )
       
    27 			continue;
    26 		if ( $block{0} == '<' )
    28 		if ( $block{0} == '<' )
    27 			continue;
    29 			continue;
    28 		
    30 		
    29 		// split by words
    31 		// split by words
    30 		$block = preg_split('/(\s+)/', $block, NULL, PREG_SPLIT_DELIM_CAPTURE);
    32 		$block = preg_split('/(\s+)/', $block, NULL, PREG_SPLIT_DELIM_CAPTURE);