equal
deleted
inserted
replaced
12 |
12 |
13 $plugins->attachHook('render_wikiformat_post', 'anti_sopa_censor($text);'); |
13 $plugins->attachHook('render_wikiformat_post', 'anti_sopa_censor($text);'); |
14 |
14 |
15 function anti_sopa_censor(&$text) |
15 function anti_sopa_censor(&$text) |
16 { |
16 { |
|
17 // don't censor the stop-sopa page |
|
18 global $db, $session, $paths, $template, $plugins; // Common objects |
|
19 if ( $paths->page_id == 'activism/stop-sopa' && $paths->namespace == 'Article' ) |
|
20 return; |
|
21 |
17 // save HTML tags |
22 // save HTML tags |
18 $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); |
19 foreach ( $text as &$block ) |
24 foreach ( $text as &$block ) |
20 { |
25 { |
21 if ( $block{0} == '<' ) |
26 if ( $block{0} == '<' ) |