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 );
|
||||
if( is_string( $blacklisted ) ) {
|
||||
//return wfMsgWikiHtml( "titleblacklist-forbidden-edit", htmlspecialchars( $blacklisted ), $title->getFullText() );
|
||||
return $result = false;
|
||||
$result = array( 'titleblacklist-forbidden-edit', htmlspecialchars( $blacklisted ), $title->getFullText() );
|
||||
return false;
|
||||
}
|
||||
|
||||
return $result = true;
|
||||
|
|
|
@ -43,8 +43,7 @@ function efSetupTitleBlacklistMessages() {
|
|||
|
||||
function efSetupTitleBlacklistHooks() {
|
||||
global $wgHooks;
|
||||
$titleBlacklistHooks = new TitleBlacklistHooks();
|
||||
$wgHooks['userCan'][] = array( $titleBlacklistHooks, 'userCan' );
|
||||
$wgHooks['AbortMove'][] = array( $titleBlacklistHooks, 'abortMove' );
|
||||
$wgHooks['UploadVerification'][] = array( $titleBlacklistHooks, 'verifyUpload' );
|
||||
$wgHooks['getUserPermissionsErrors'][] = 'TitleBlacklistHooks::userCan';
|
||||
$wgHooks['AbortMove'][] = 'TitleBlacklistHooks::abortMove';
|
||||
$wgHooks['UploadVerification'][] = 'TitleBlacklistHooks::verifyUpload';
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue