Index: trunk/extensions/TitleBlacklist/TitleBlacklist.hooks.php |
— | — | @@ -19,7 +19,6 @@ |
20 | 20 | efInitTitleBlacklist(); |
21 | 21 | $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, $action ); |
22 | 22 | if( $blacklisted instanceof TitleBlacklistEntry ) { |
23 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
24 | 23 | $message = $blacklisted->getCustomMessage(); |
25 | 24 | if( is_null( $message ) ) |
26 | 25 | $message = 'titleblacklist-forbidden-edit'; |
— | — | @@ -40,7 +39,6 @@ |
41 | 40 | if( !$blacklisted ) |
42 | 41 | $blacklisted = $wgTitleBlacklist->isBlacklisted( $old, 'edit' ); |
43 | 42 | if( $blacklisted instanceof TitleBlacklistEntry ) { |
44 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
45 | 43 | $message = $blacklisted->getCustomMessage(); |
46 | 44 | if( is_null( $message ) ) |
47 | 45 | $message = 'titleblacklist-forbidden-move'; |
— | — | @@ -64,12 +62,11 @@ |
65 | 63 | private static function acceptNewUserName( $userName, &$err ) { |
66 | 64 | global $wgTitleBlacklist; |
67 | 65 | efInitTitleBlacklist(); |
68 | | - $title = Title::newFromText( $userName, NS_USER ); |
| 66 | + $title = Title::makeTitleSafe( NS_USER, $userName ); |
69 | 67 | $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, 'new-account' ); |
70 | 68 | if( !( $blacklisted instanceof TitleBlacklistEntry ) ) |
71 | 69 | $blacklisted = $wgTitleBlacklist->isBlacklisted( $title, 'create' ); |
72 | 70 | if( $blacklisted instanceof TitleBlacklistEntry ) { |
73 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
74 | 71 | $message = $blacklisted->getCustomMessage(); |
75 | 72 | if ( is_null( $message ) ) |
76 | 73 | $message = 'titleblacklist-forbidden-new-account'; |
— | — | @@ -106,7 +103,6 @@ |
107 | 104 | return true; |
108 | 105 | } |
109 | 106 | |
110 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
111 | 107 | $errmsg = wfMsgExt( 'titleblacklist-invalid', array( 'parsemag' ), count( $ok ) ); |
112 | 108 | $errlines = '* <tt>' . implode( "</tt>\n* <tt>", array_map( 'wfEscapeWikiText', $ok ) ) . '</tt>'; |
113 | 109 | $error = Html::openElement( 'div', array( 'class' => 'errorbox' ) ) . |
— | — | @@ -124,7 +120,6 @@ |
125 | 121 | if( $retitle !== null && !$retitle->exists() ) { |
126 | 122 | $blacklisted = $wgTitleBlacklist->isBlacklisted( $retitle, 'create' ); |
127 | 123 | if( $blacklisted instanceof TitleBlacklistEntry ) { |
128 | | - wfLoadExtensionMessages( 'TitleBlacklist' ); |
129 | 124 | $error = Html::openElement( 'div', array( 'class' => 'errorbox' ) ) . |
130 | 125 | wfMsg( 'titleblacklist-forbidden-edit', |
131 | 126 | htmlspecialchars( $blacklisted->getRaw() ), |