diff --git a/TitleBlacklist.hooks.php b/TitleBlacklist.hooks.php index 1d7e73f9..74d15653 100644 --- a/TitleBlacklist.hooks.php +++ b/TitleBlacklist.hooks.php @@ -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; diff --git a/TitleBlacklist.php b/TitleBlacklist.php index 75ad8d3c..fb7f757d 100644 --- a/TitleBlacklist.php +++ b/TitleBlacklist.php @@ -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'; }