mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-11-28 07:50:32 +00:00
TitleBlacklist:
Use a better hook (getUserPermissionsErrors)
This commit is contained in:
parent
9ecaa4f5b2
commit
281c040bd2
|
@ -20,8 +20,8 @@ class TitleBlacklistHooks {
|
||||||
}
|
}
|
||||||
$blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action );
|
$blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action );
|
||||||
if( is_string( $blacklisted ) ) {
|
if( is_string( $blacklisted ) ) {
|
||||||
//return wfMsgWikiHtml( "titleblacklist-forbidden-edit", htmlspecialchars( $blacklisted ), $title->getFullText() );
|
$result = array( 'titleblacklist-forbidden-edit', htmlspecialchars( $blacklisted ), $title->getFullText() );
|
||||||
return $result = false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result = true;
|
return $result = true;
|
||||||
|
|
|
@ -43,8 +43,7 @@ function efSetupTitleBlacklistMessages() {
|
||||||
|
|
||||||
function efSetupTitleBlacklistHooks() {
|
function efSetupTitleBlacklistHooks() {
|
||||||
global $wgHooks;
|
global $wgHooks;
|
||||||
$titleBlacklistHooks = new TitleBlacklistHooks();
|
$wgHooks['getUserPermissionsErrors'][] = 'TitleBlacklistHooks::userCan';
|
||||||
$wgHooks['userCan'][] = array( $titleBlacklistHooks, 'userCan' );
|
$wgHooks['AbortMove'][] = 'TitleBlacklistHooks::abortMove';
|
||||||
$wgHooks['AbortMove'][] = array( $titleBlacklistHooks, 'abortMove' );
|
$wgHooks['UploadVerification'][] = 'TitleBlacklistHooks::verifyUpload';
|
||||||
$wgHooks['UploadVerification'][] = array( $titleBlacklistHooks, 'verifyUpload' );
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue