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