TitleBlacklist:

Use a better hook (getUserPermissionsErrors)
This commit is contained in:
Victor Vasiliev 2007-12-15 06:16:19 +00:00
parent 9ecaa4f5b2
commit 281c040bd2
2 changed files with 5 additions and 6 deletions

View file

@ -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;

View file

@ -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';
}