Censorship.php
changeset 3 28a899aa460e
parent 2 c8e6db42385f
child 4 4994af009663
equal deleted inserted replaced
2:c8e6db42385f 3:28a899aa460e
    18 	global $db, $session, $paths, $template, $plugins; // Common objects
    18 	global $db, $session, $paths, $template, $plugins; // Common objects
    19 	if ( $paths->page_id == 'activism/stop-sopa' && $paths->namespace == 'Article' )
    19 	if ( $paths->page_id == 'activism/stop-sopa' && $paths->namespace == 'Article' )
    20 		return;
    20 		return;
    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>|<a class="downloadbutton.*?<\/a>)/', $text, NULL, PREG_SPLIT_DELIM_CAPTURE);
    24 	foreach ( $text as &$block )
    24 	foreach ( $text as &$block )
    25 	{
    25 	{
    26 		if ( strlen($block) < 1 )
    26 		if ( strlen($block) < 1 )
    27 			continue;
    27 			continue;
    28 		if ( $block{0} == '<' )
    28 		if ( $block{0} == '<' )