Censorship.php
changeset 4 4994af009663
parent 3 28a899aa460e
child 5 ce6af7a8f827
equal deleted inserted replaced
3:28a899aa460e 4:4994af009663
    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>|<a class="downloadbutton.*?<\/a>)/', $text, NULL, PREG_SPLIT_DELIM_CAPTURE);
    23 	$text = preg_split('/(<(?:[a-z\/].+?|!--.+?--)>|<script[^>]*>.*?<\/script>|<a class="downloadbutton.*?<\/a>)/m', $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} == '<' )