isBlacklisted( $title, $action ); if( $blacklisted instanceof TitleBlacklistEntry ) { $message = $blacklisted->getCustomMessage(); if( is_null( $message ) ) $message = 'titleblacklist-forbidden-edit'; $result = array( $message, htmlspecialchars( $blacklisted->getRaw() ), $title->getFullText() ); return false; } } return true; } public static function abortMove( $old, $nt, $user, &$err ) { wfLoadExtensionMessages( 'TitleBlacklist' ); global $wgTitleBlacklist; $blacklisted = $wgTitleBlacklist->isBlacklisted( $nt, 'move' ); if( !$blacklisted ) $blacklisted = $wgTitleBlacklist->isBlacklisted( $old, 'edit' ); if( $blacklisted instanceof TitleBlacklistEntry ) { $message = $blacklisted->getCustomMessage(); if( is_null( $message ) ) $message = 'titleblacklist-forbidden-move'; $err = wfMsgWikiHtml( $message, htmlspecialchars( $blacklisted->getRaw() ), htmlspecialchars( $nt->getFullText() ), htmlspecialchars( $old->getFullText() ) ); return false; } return true; } public static function verifyUpload( $fname, $fpath, &$err ) { wfLoadExtensionMessages( 'TitleBlacklist' ); global $wgTitleBlacklist, $wgUser; $blacklisted = $wgTitleBlacklist->isBlacklisted( Title::newFromText( $fname, NS_IMAGE ), 'upload' ); if( $blacklisted instanceof TitleBlacklistEntry ) { $message = $blacklisted->getCustomMessage(); if( is_null( $message ) ) $message = 'titleblacklist-forbidden-upload'; $err = wfMsgWikiHtml( $message, htmlspecialchars( $blacklisted->getRaw() ), $fname ); return false; } return true; } public static function validateBlacklist( $editor, $text, $section, $error ) { global $wgTitleBlacklist; $title = $editor->mTitle; if( $title->getNamespace() != NS_MEDIAWIKI || $title->getDbKey() != 'Titleblacklist' ) return true; wfLoadExtensionMessages( 'TitleBlacklist' ); $bl = $wgTitleBlacklist->parseBlacklist( $text ); $ok = $wgTitleBlacklist->validate( $bl ); if( count( $ok ) == 0 ) { return true; } $errmsg = wfMsgExt( 'titleblacklist-invalid', array( 'parsemag' ), count( $ok ) ); $errlines = '* ' . implode( "\n* ", array_map( 'wfEscapeWikiText', $ok ) ) . ''; $error = '