Index: trunk/extensions/RemoveRedlinks/RemoveRedlinks.php |
— | — | @@ -21,11 +21,20 @@ |
22 | 22 | 'author' => '[mailto:innocentkiller@gmail.com Chad Horohoe]', |
23 | 23 | ); |
24 | 24 | |
| 25 | +// Restrict link removal to anons only |
| 26 | +$wgRRAnonOnly = false; |
| 27 | + |
25 | 28 | // Hook Registering |
26 | 29 | $wgHooks['LinkBegin'][] = 'efRemoveRedlinks'; |
27 | 30 | |
28 | 31 | // And the function |
29 | 32 | function efRemoveRedlinks( $skin, $target, &$text, &$customAttribs, &$query, &$options, &$ret ) { |
| 33 | + global $wgRRAnonOnly, $wgUser; |
| 34 | + |
| 35 | + // return possibly if we're not an anon |
| 36 | + if( $wgRRAnonOnly && $wgUser->isLoggedIn() ) { |
| 37 | + return true; |
| 38 | + } |
30 | 39 | // return immediately if we know it's real |
31 | 40 | if ( in_array( 'known', $options ) ) { |
32 | 41 | return true; |