Index: trunk/extensions/TitleBlacklist/TitleBlacklist.php |
— | — | @@ -46,7 +46,6 @@ |
47 | 47 | $wgHooks['getUserPermissionsErrorsExpensive'][] = 'TitleBlacklistHooks::userCan'; |
48 | 48 | $wgHooks['AbortMove'][] = 'TitleBlacklistHooks::abortMove'; |
49 | 49 | $wgHooks['AbortNewAccount'][] = 'TitleBlacklistHooks::abortNewAccount'; |
50 | | -$wgHooks['AuthPluginAutoCreate'][] = 'TitleBlacklistHooks::abortNewAccountAuto'; |
51 | 50 | $wgHooks['EditFilter'][] = 'TitleBlacklistHooks::validateBlacklist'; |
52 | 51 | $wgHooks['ArticleSaveComplete'][] = 'TitleBlacklistHooks::clearBlacklist'; |
53 | 52 | |
Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php |
— | — | @@ -84,44 +84,27 @@ |
85 | 85 | global $wgTitleBlacklist; |
86 | 86 | efInitTitleBlacklist(); |
87 | 87 | $title = $editor->mTitle; |
88 | | - if( $title->getNamespace() == NS_MEDIAWIKI && $title->getDBkey() == 'Titleblacklist' ) { |
89 | | - |
90 | | - $bl = $wgTitleBlacklist->parseBlacklist( $text ); |
91 | | - $ok = $wgTitleBlacklist->validate( $bl ); |
92 | | - if( count( $ok ) == 0 ) { |
93 | | - return true; |
94 | | - } |
95 | | - |
96 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
97 | | - $errmsg = wfMsgExt( 'titleblacklist-invalid', array( 'parsemag' ), count( $ok ) ); |
98 | | - $errlines = '* <tt>' . implode( "</tt>\n* <tt>", array_map( 'wfEscapeWikiText', $ok ) ) . '</tt>'; |
99 | | - $error = '<div class="errorbox">' . |
100 | | - $errmsg . |
101 | | - "\n" . |
102 | | - $errlines . |
103 | | - "</div>\n" . |
104 | | - "<br clear='all' />\n"; |
105 | | - |
106 | | - // $error will be displayed by the edit class |
| 88 | + if( $title->getNamespace() != NS_MEDIAWIKI || $title->getDBkey() != 'Titleblacklist' ) |
107 | 89 | return true; |
108 | | - } else if (!$section) { |
109 | | - # Block redirects to nonexistent blacklisted titles |
110 | | - $retitle = Title::newFromRedirect( $text ); |
111 | | - if ( $retitle !== null && !$retitle->exists() ) { |
112 | | - $blacklisted = $wgTitleBlacklist->isBlacklisted( $retitle, 'create' ); |
113 | | - if ( $blacklisted instanceof TitleBlacklistEntry ) { |
114 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
115 | | - $error = ( '<div class="errorbox">' . |
116 | | - wfMsg( 'titleblacklist-forbidden-edit', |
117 | | - htmlspecialchars( $blacklisted->getRaw() ), |
118 | | - $retitle->getFullText() ) . |
119 | | - "</div>\n" . |
120 | | - "<br clear='all' />\n" ); |
121 | | - } |
122 | | - } |
123 | 90 | |
| 91 | + $bl = $wgTitleBlacklist->parseBlacklist( $text ); |
| 92 | + $ok = $wgTitleBlacklist->validate( $bl ); |
| 93 | + if( count( $ok ) == 0 ) { |
124 | 94 | return true; |
125 | 95 | } |
| 96 | + |
| 97 | + wfLoadExtensionMessages( 'TitleBlacklist' ); |
| 98 | + $errmsg = wfMsgExt( 'titleblacklist-invalid', array( 'parsemag' ), count( $ok ) ); |
| 99 | + $errlines = '* <tt>' . implode( "</tt>\n* <tt>", array_map( 'wfEscapeWikiText', $ok ) ) . '</tt>'; |
| 100 | + $error = '<div class="errorbox">' . |
| 101 | + $errmsg . |
| 102 | + "\n" . |
| 103 | + $errlines . |
| 104 | + "</div>\n" . |
| 105 | + "<br clear='all' />\n"; |
| 106 | + |
| 107 | + // $error will be displayed by the edit class |
| 108 | + return true; |
126 | 109 | } |
127 | 110 | |
128 | 111 | /** ArticleSaveComplete hook */ |