r58280 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58279‎ | r58280 | r58281 >
Date:19:45, 28 October 2009
Author:demon
Status:deferred
Tags:
Comment:
Add global to make redlink disabling anon-only
Modified paths:
  • /trunk/extensions/RemoveRedlinks/RemoveRedlinks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RemoveRedlinks/RemoveRedlinks.php
@@ -21,11 +21,20 @@
2222 'author' => '[mailto:innocentkiller@gmail.com Chad Horohoe]',
2323 );
2424
 25+// Restrict link removal to anons only
 26+$wgRRAnonOnly = false;
 27+
2528 // Hook Registering
2629 $wgHooks['LinkBegin'][] = 'efRemoveRedlinks';
2730
2831 // And the function
2932 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+ }
3039 // return immediately if we know it's real
3140 if ( in_array( 'known', $options ) ) {
3241 return true;

Status & tagging log