Index: trunk/extensions/GlobalBlocking/SpecialRemoveGlobalBlock.php |
— | — | @@ -8,19 +8,17 @@ |
9 | 9 | } |
10 | 10 | |
11 | 11 | function execute( $par ) { |
12 | | - global $wgUser; |
| 12 | + global $wgOut, $wgRequest, $wgUser; |
13 | 13 | $this->setHeaders(); |
14 | 14 | |
15 | 15 | $this->loadParameters(); |
16 | 16 | |
17 | | - $out = $this->getOutput(); |
| 17 | + $wgOut->setPageTitle( wfMsg( 'globalblocking-unblock' ) ); |
| 18 | + $wgOut->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'RemoveGlobalBlock' ) ); |
| 19 | + $wgOut->setRobotPolicy( "noindex,nofollow" ); |
| 20 | + $wgOut->setArticleRelated( false ); |
| 21 | + $wgOut->enableClientCache( false ); |
18 | 22 | |
19 | | - $out->setPageTitle( wfMsg( 'globalblocking-unblock' ) ); |
20 | | - $out->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'RemoveGlobalBlock' ) ); |
21 | | - $out->setRobotPolicy( "noindex,nofollow" ); |
22 | | - $out->setArticleRelated( false ); |
23 | | - $out->enableClientCache( false ); |
24 | | - |
25 | 23 | if (!$this->userCanExecute( $wgUser )) { |
26 | 24 | $this->displayRestrictionError(); |
27 | 25 | return; |
— | — | @@ -28,8 +26,7 @@ |
29 | 27 | |
30 | 28 | $errors = ''; |
31 | 29 | |
32 | | - $request = $this->getRequest(); |
33 | | - if ( $request->wasPosted() && $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { |
| 30 | + if ($wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ))) { |
34 | 31 | // They want to submit. Let's have a look. |
35 | 32 | $errors = $this->trySubmit(); |
36 | 33 | if( !$errors ) { |
— | — | @@ -37,12 +34,12 @@ |
38 | 35 | return; |
39 | 36 | } |
40 | 37 | } |
| 38 | + |
| 39 | + $wgOut->addWikiMsg( 'globalblocking-unblock-intro' ); |
41 | 40 | |
42 | | - $out->addWikiMsg( 'globalblocking-unblock-intro' ); |
43 | | - |
44 | 41 | if (is_array($errors) && count($errors)>0) { |
45 | 42 | $errorstr = ''; |
46 | | - |
| 43 | + |
47 | 44 | foreach ( $errors as $error ) { |
48 | 45 | if (is_array($error)) { |
49 | 46 | $msg = array_shift($error); |
— | — | @@ -52,14 +49,15 @@ |
53 | 50 | } |
54 | 51 | $errorstr .= Xml::tags( 'li', null, wfMsgExt( $msg, array( 'parseinline' ), $error ) ); |
55 | 52 | } |
56 | | - |
| 53 | + |
57 | 54 | $errorstr = Xml::tags( 'ul', array( 'class' => 'error' ), $errorstr ); |
58 | 55 | $errorstr = wfMsgExt( 'globalblocking-unblock-errors', array('parse'), array( count( $errors ) ) ) . $errorstr; |
59 | 56 | $errorstr = Xml::tags( 'div', array( 'class' => 'error' ), $errorstr ); |
60 | | - $out->addHTML( $errorstr ); |
| 57 | + $wgOut->addHTML( $errorstr ); |
61 | 58 | } |
| 59 | + |
| 60 | + $this->form( ); |
62 | 61 | |
63 | | - $this->form(); |
64 | 62 | } |
65 | 63 | |
66 | 64 | function loadParameters() { |
— | — | @@ -70,7 +68,7 @@ |
71 | 69 | } |
72 | 70 | |
73 | 71 | function trySubmit() { |
74 | | - global $wgOut; |
| 72 | + global $wgOut,$wgUser; |
75 | 73 | $errors = array(); |
76 | 74 | $ip = $this->mUnblockIP; |
77 | 75 | if (!IP::isIPAddress($ip) && strlen($ip)) { |
— | — | @@ -86,7 +84,6 @@ |
87 | 85 | return $errors; |
88 | 86 | } |
89 | 87 | |
90 | | - $out = $this->getOutput(); |
91 | 88 | $dbw = GlobalBlocking::getGlobalBlockingMaster(); |
92 | 89 | $dbw->delete( 'globalblocks', array( 'gb_id' => $id ), __METHOD__ ); |
93 | 90 | |
— | — | @@ -94,12 +91,12 @@ |
95 | 92 | $page->addEntry( 'gunblock', Title::makeTitleSafe( NS_USER, $ip ), $this->mReason ); |
96 | 93 | |
97 | 94 | $successmsg = wfMsgExt( 'globalblocking-unblock-unblocked', array( 'parse' ), $ip, $id ); |
98 | | - $out->addHTML( $successmsg ); |
| 95 | + $wgOut->addHTML( $successmsg ); |
99 | 96 | |
100 | | - $link = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'GlobalBlockList' ), wfMsg( 'globalblocking-return' ) ); |
101 | | - $out->addHTML( $link ); |
| 97 | + $link = $wgUser->getSkin()->makeKnownLinkObj( SpecialPage::getTitleFor( 'GlobalBlockList' ), wfMsg( 'globalblocking-return' ) ); |
| 98 | + $wgOut->addHTML( $link ); |
102 | 99 | |
103 | | - $out->setSubtitle(wfMsg('globalblocking-unblock-successsub')); |
| 100 | + $wgOut->setSubtitle(wfMsg('globalblocking-unblock-successsub')); |
104 | 101 | |
105 | 102 | return array(); |
106 | 103 | } |
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlock.php |
— | — | @@ -10,17 +10,16 @@ |
11 | 11 | } |
12 | 12 | |
13 | 13 | function execute( $par ) { |
14 | | - global $wgUser; |
| 14 | + global $wgOut, $wgRequest, $wgUser; |
15 | 15 | $this->setHeaders(); |
16 | 16 | |
17 | 17 | $this->loadParameters( $par ); |
18 | 18 | |
19 | | - $out = $this->getOutput(); |
20 | | - $out->setPageTitle( wfMsg( 'globalblocking-block' ) ); |
21 | | - $out->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'GlobalBlock' ) ); |
22 | | - $out->setRobotPolicy( "noindex,nofollow" ); |
23 | | - $out->setArticleRelated( false ); |
24 | | - $out->enableClientCache( false ); |
| 19 | + $wgOut->setPageTitle( wfMsg( 'globalblocking-block' ) ); |
| 20 | + $wgOut->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'GlobalBlock' ) ); |
| 21 | + $wgOut->setRobotPolicy( "noindex,nofollow" ); |
| 22 | + $wgOut->setArticleRelated( false ); |
| 23 | + $wgOut->enableClientCache( false ); |
25 | 24 | |
26 | 25 | if (!$this->userCanExecute( $wgUser )) { |
27 | 26 | $this->displayRestrictionError(); |
— | — | @@ -29,8 +28,7 @@ |
30 | 29 | |
31 | 30 | $errors = ''; |
32 | 31 | |
33 | | - $request = $this->getRequest(); |
34 | | - if ( $request->wasPosted() && $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { |
| 32 | + if ($wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ))) { |
35 | 33 | // They want to submit. Let's have a look. |
36 | 34 | $errors = $this->trySubmit(); |
37 | 35 | if( !$errors ) { |
— | — | @@ -116,14 +114,15 @@ |
117 | 115 | } |
118 | 116 | |
119 | 117 | function trySubmit() { |
| 118 | + global $wgOut, $wgUser; |
120 | 119 | $options = array(); |
| 120 | + $skin = $wgUser->getSkin(); |
121 | 121 | |
122 | 122 | if ($this->mAnonOnly) |
123 | 123 | $options[] = 'anon-only'; |
124 | 124 | if ($this->mModify) |
125 | 125 | $options[] = 'modify'; |
126 | 126 | |
127 | | - $out = $this->getOutput(); |
128 | 127 | $reasonstr = $this->mReasonList; |
129 | 128 | if( $reasonstr != 'other' && $this->mReason != '' ) { |
130 | 129 | // Entry from drop down menu + additional comment |
— | — | @@ -146,12 +145,12 @@ |
147 | 146 | $subMessage = 'globalblocking-block-successsub'; |
148 | 147 | } |
149 | 148 | |
150 | | - $out->addWikitext( wfMsg($textMessage, $this->mAddress ) ); |
151 | | - $out->setSubtitle( wfMsg( $subMessage ) ); |
| 149 | + $wgOut->addWikitext( wfMsg($textMessage, $this->mAddress ) ); |
| 150 | + $wgOut->setSubtitle( wfMsg( $subMessage ) ); |
152 | 151 | |
153 | | - $link = Linker::link( SpecialPage::getTitleFor( 'GlobalBlockList' ), |
| 152 | + $link = $skin->link( SpecialPage::getTitleFor( 'GlobalBlockList' ), |
154 | 153 | wfMsg( 'globalblocking-return' ) ); |
155 | | - $out->addHTML( $link ); |
| 154 | + $wgOut->addHTML( $link ); |
156 | 155 | |
157 | 156 | return array(); |
158 | 157 | } |
Index: trunk/extensions/GlobalBlocking/GlobalBlocking.class.php |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | */ |
44 | 44 | static function getUserBlockErrors( $user, $ip ) { |
45 | 45 | static $result = null; |
46 | | - |
| 46 | + |
47 | 47 | // Instance cache |
48 | 48 | if ( !is_null( $result ) ) { |
49 | 49 | return $result; |
— | — | @@ -57,7 +57,7 @@ |
58 | 58 | // Block has been whitelisted. |
59 | 59 | return $result = array(); |
60 | 60 | } |
61 | | - |
| 61 | + |
62 | 62 | if ( $user->isAllowed( 'ipblock-exempt' ) || $user->isAllowed( 'globalblock-exempt' ) ) { |
63 | 63 | // User is exempt from IP blocks. |
64 | 64 | return $result = array(); |
— | — | @@ -72,10 +72,10 @@ |
73 | 73 | } else { |
74 | 74 | $blockExpiry = $wgLang->timeanddate( wfTimestamp( TS_MW, $blockExpiry ), true ); |
75 | 75 | } |
76 | | - |
| 76 | + |
77 | 77 | $display_wiki = self::getWikiName( $block->gb_by_wiki ); |
78 | 78 | $blockingUser = self::maybeLinkUserpage( $block->gb_by_wiki, $block->gb_by ); |
79 | | - |
| 79 | + |
80 | 80 | return $result = array( 'globalblocking-ipblocked', |
81 | 81 | $blockingUser, $display_wiki, $block->gb_reason, $blockTimestamp, $blockExpiry, $ip ); |
82 | 82 | } |
— | — | @@ -95,7 +95,7 @@ |
96 | 96 | $hex_ip = IP::toHex( $ip ); |
97 | 97 | $ip_pattern = substr( $hex_ip, 0, 4 ) . '%'; // Don't bother checking blocks out of this /16. |
98 | 98 | |
99 | | - $conds = array( |
| 99 | + $conds = array( |
100 | 100 | 'gb_range_end>='.$dbr->addQuotes( $hex_ip ), // This block in the given range. |
101 | 101 | 'gb_range_start<='.$dbr->addQuotes( $hex_ip ), |
102 | 102 | 'gb_range_start like ' . $dbr->addQuotes( $ip_pattern ), |
— | — | @@ -115,32 +115,32 @@ |
116 | 116 | global $wgGlobalBlockingDatabase; |
117 | 117 | return wfGetDB( DB_MASTER, 'globalblocking', $wgGlobalBlockingDatabase ); |
118 | 118 | } |
119 | | - |
| 119 | + |
120 | 120 | static function getGlobalBlockingSlave() { |
121 | 121 | global $wgGlobalBlockingDatabase; |
122 | 122 | return wfGetDB( DB_SLAVE, 'globalblocking', $wgGlobalBlockingDatabase ); |
123 | 123 | } |
124 | | - |
| 124 | + |
125 | 125 | static function getGlobalBlockId( $ip ) { |
126 | 126 | $dbr = GlobalBlocking::getGlobalBlockingSlave(); |
127 | | - |
| 127 | + |
128 | 128 | if (!($row = $dbr->selectRow( 'globalblocks', 'gb_id', array( 'gb_address' => $ip ), __METHOD__ ))) |
129 | 129 | return 0; |
130 | | - |
| 130 | + |
131 | 131 | return $row->gb_id; |
132 | 132 | } |
133 | | - |
| 133 | + |
134 | 134 | static function purgeExpired() { |
135 | 135 | // This is expensive. It involves opening a connection to a new master, |
136 | 136 | // and doing a write query. We should only do it when a connection to the master |
137 | 137 | // is already open (currently, when a global block is made). |
138 | 138 | $dbw = GlobalBlocking::getGlobalBlockingMaster(); |
139 | | - |
| 139 | + |
140 | 140 | // Stand-alone transaction. |
141 | 141 | $dbw->begin(); |
142 | 142 | $dbw->delete( 'globalblocks', array('gb_expiry<'.$dbw->addQuotes($dbw->timestamp())), __METHOD__ ); |
143 | 143 | $dbw->commit(); |
144 | | - |
| 144 | + |
145 | 145 | // Purge the global_block_whitelist table. |
146 | 146 | // We can't be perfect about this without an expensive check on the master |
147 | 147 | // for every single global block. However, we can be clever about it and store |
— | — | @@ -151,7 +151,7 @@ |
152 | 152 | $dbw->delete( 'global_block_whitelist', array( 'gbw_expiry<'.$dbw->addQuotes($dbw->timestamp())), __METHOD__ ); |
153 | 153 | $dbw->commit(); |
154 | 154 | } |
155 | | - |
| 155 | + |
156 | 156 | static function getWhitelistInfo( $id = null, $address = null ) { |
157 | 157 | if ($id != null) { |
158 | 158 | $conds = array( 'gbw_id' => $id ); |
— | — | @@ -161,10 +161,10 @@ |
162 | 162 | //WTF? |
163 | 163 | throw new MWException( "Neither Block IP nor Block ID given for retrieving whitelist status" ); |
164 | 164 | } |
165 | | - |
| 165 | + |
166 | 166 | $dbr = wfGetDB( DB_SLAVE ); |
167 | 167 | $row = $dbr->selectRow( 'global_block_whitelist', array( 'gbw_by', 'gbw_reason' ), $conds, __METHOD__ ); |
168 | | - |
| 168 | + |
169 | 169 | if ($row == false) { |
170 | 170 | // Not whitelisted. |
171 | 171 | return false; |
— | — | @@ -173,45 +173,45 @@ |
174 | 174 | return array( 'user' => $row->gbw_by, 'reason' => $row->gbw_reason ); |
175 | 175 | } |
176 | 176 | } |
177 | | - |
| 177 | + |
178 | 178 | static function getWhitelistInfoByIP( $block_ip ) { |
179 | 179 | return self::getWhitelistInfo( null, $block_ip ); |
180 | 180 | } |
181 | | - |
| 181 | + |
182 | 182 | static function getWikiName( $wiki_id ) { |
183 | 183 | if (class_exists('WikiMap')) { |
184 | 184 | // We can give more info than just the wiki id! |
185 | 185 | $wiki = WikiMap::getWiki( $wiki_id ); |
186 | | - |
| 186 | + |
187 | 187 | if ($wiki) { |
188 | 188 | return $wiki->getDisplayName(); |
189 | 189 | } |
190 | 190 | } |
191 | | - |
| 191 | + |
192 | 192 | return $wiki_id; |
193 | 193 | } |
194 | | - |
| 194 | + |
195 | 195 | static function maybeLinkUserpage( $wiki_id, $user ) { |
196 | 196 | if (class_exists( 'WikiMap')) { |
197 | 197 | $wiki = WikiMap::getWiki( $wiki_id ); |
198 | | - |
| 198 | + |
199 | 199 | if ($wiki) { |
200 | 200 | return "[".$wiki->getUrl( "User:$user" )." $user]"; |
201 | 201 | } |
202 | 202 | } |
203 | 203 | return $user; |
204 | 204 | } |
205 | | - |
| 205 | + |
206 | 206 | static function insertBlock( $address, $reason, $expiry, $options = array() ) { |
207 | 207 | global $wgUser; |
208 | 208 | $errors = array(); |
209 | | - |
| 209 | + |
210 | 210 | ## Purge expired blocks. |
211 | 211 | GlobalBlocking::purgeExpired(); |
212 | 212 | |
213 | 213 | ## Validate input |
214 | 214 | $ip = IP::sanitizeIP( $address ); |
215 | | - |
| 215 | + |
216 | 216 | $anonOnly = in_array( 'anon-only', $options ); |
217 | 217 | $modify = in_array( 'modify', $options ); |
218 | 218 | |
— | — | @@ -219,37 +219,37 @@ |
220 | 220 | // Invalid IP address. |
221 | 221 | $errors[] = array( 'globalblocking-block-ipinvalid', $ip ); |
222 | 222 | } |
223 | | - |
| 223 | + |
224 | 224 | if ( false === $expiry ) { |
225 | 225 | $errors[] = array( 'globalblocking-block-expiryinvalid', $expiry ); |
226 | 226 | } |
227 | | - |
| 227 | + |
228 | 228 | $existingBlock = GlobalBlocking::getGlobalBlockId($ip); |
229 | 229 | if ( !$modify && $existingBlock ) { |
230 | 230 | $errors[] = array( 'globalblocking-block-alreadyblocked', $ip ); |
231 | 231 | } |
232 | | - |
| 232 | + |
233 | 233 | // Check for too-big ranges. |
234 | 234 | list( $range_start, $range_end ) = IP::parseRange( $ip ); |
235 | | - |
| 235 | + |
236 | 236 | if (substr( $range_start, 0, 4 ) != substr( $range_end, 0, 4 )) { |
237 | 237 | // Range crosses a /16 boundary. |
238 | 238 | $errors[] = array( 'globalblocking-block-bigrange', $ip ); |
239 | 239 | } |
240 | | - |
| 240 | + |
241 | 241 | // Normalise the range |
242 | 242 | if ($range_start != $range_end) { |
243 | 243 | $ip = Block::normaliseRange( $ip ); |
244 | 244 | } |
245 | | - |
| 245 | + |
246 | 246 | if (count($errors)>0) |
247 | 247 | return $errors; |
248 | 248 | |
249 | 249 | // We're a-ok. |
250 | 250 | $dbw = GlobalBlocking::getGlobalBlockingMaster(); |
251 | | - |
| 251 | + |
252 | 252 | // Delete the old block, if applicable |
253 | | - |
| 253 | + |
254 | 254 | if ($modify) { |
255 | 255 | $dbw->delete( 'globalblocks', array( 'gb_id' => $existingBlock ), __METHOD__ ); |
256 | 256 | } |
— | — | @@ -265,36 +265,36 @@ |
266 | 266 | list( $row['gb_range_start'], $row['gb_range_end'] ) = array( $range_start, $range_end ); |
267 | 267 | |
268 | 268 | $dbw->insert( 'globalblocks', $row, __METHOD__ ); |
269 | | - |
| 269 | + |
270 | 270 | return array(); |
271 | 271 | } |
272 | | - |
| 272 | + |
273 | 273 | static function block( $address, $reason, $expiry, $options = array() ) { |
274 | 274 | global $wgContLang; |
275 | | - |
| 275 | + |
276 | 276 | $expiry = SpecialBlock::parseExpiryInput( $expiry ); |
277 | 277 | $errors = self::insertBlock( $address, $reason, $expiry, $options ); |
278 | | - |
| 278 | + |
279 | 279 | if ( count($errors) > 0 ) |
280 | 280 | return $errors; |
281 | | - |
| 281 | + |
282 | 282 | $anonOnly = in_array( 'anon-only', $options ); |
283 | 283 | $modify = in_array( 'modify', $options ); |
284 | 284 | |
285 | 285 | // Log it. |
286 | 286 | $logAction = $modify ? 'modify' : 'gblock2'; |
287 | 287 | $flags = array(); |
288 | | - |
| 288 | + |
289 | 289 | if ($anonOnly) |
290 | 290 | $flags[] = wfMsgForContent( 'globalblocking-list-anononly' ); |
291 | | - |
| 291 | + |
292 | 292 | if ( $expiry != 'infinity' ) { |
293 | 293 | $displayExpiry = $wgContLang->timeanddate( $expiry ); |
294 | 294 | $flags[] = wfMsgForContent( 'globalblocking-logentry-expiry', $displayExpiry ); |
295 | 295 | } else { |
296 | 296 | $flags[] = wfMsgForContent( 'globalblocking-logentry-noexpiry' ); |
297 | 297 | } |
298 | | - |
| 298 | + |
299 | 299 | $info = implode( ', ', $flags ); |
300 | 300 | |
301 | 301 | $page = new LogPage( 'gblblock' ); |
— | — | @@ -306,10 +306,10 @@ |
307 | 307 | |
308 | 308 | return array(); |
309 | 309 | } |
310 | | - |
| 310 | + |
311 | 311 | static function onSpecialPasswordResetOnSubmit( &$users, $data, &$error ) { |
312 | 312 | global $wgUser; |
313 | | - |
| 313 | + |
314 | 314 | if ( GlobalBlocking::getUserBlockErrors( $wgUser, wfGetIp() ) ) { |
315 | 315 | $error = wfMsg( 'globalblocking-blocked-nopassreset' ); |
316 | 316 | return false; |
— | — | @@ -342,7 +342,6 @@ |
343 | 343 | ); |
344 | 344 | return true; |
345 | 345 | } |
346 | | - |
347 | 346 | /** |
348 | 347 | * Build links to other global blocking special pages, shown in the subtitle |
349 | 348 | * @param string $pagetype The calling special page name |
— | — | @@ -353,29 +352,30 @@ |
354 | 353 | |
355 | 354 | // Add a few useful links |
356 | 355 | $links = array(); |
| 356 | + $sk = $wgUser->getSkin(); |
357 | 357 | |
358 | 358 | // Don't show a link to a special page on the special page itself. |
359 | 359 | // Show the links only if the user has sufficient rights |
360 | 360 | if( $pagetype != 'GlobalBlockList' ) { |
361 | 361 | $title = SpecialPage::getTitleFor( 'GlobalBlockList' ); |
362 | | - $links[] = Linker::linkKnown( $title, wfMsg( 'globalblocklist' ) ); |
| 362 | + $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocklist' ) ); |
363 | 363 | } |
364 | 364 | |
365 | 365 | if( $pagetype != 'GlobalBlock' && $wgUser->isAllowed( 'globalblock' ) ) { |
366 | 366 | $title = SpecialPage::getTitleFor( 'GlobalBlock' ); |
367 | | - $links[] = Linker::linkKnown( $title, wfMsg( 'globalblocking-goto-block' ) ); |
| 367 | + $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-goto-block' ) ); |
368 | 368 | } |
369 | 369 | if( $pagetype != 'RemoveGlobalBlock' && $wgUser->isAllowed( 'globalunblock' ) ) { |
370 | 370 | $title = SpecialPage::getTitleFor( 'RemoveGlobalBlock' ); |
371 | | - $links[] = Linker::linkKnown( $title, wfMsg( 'globalblocking-goto-unblock' ) ); |
| 371 | + $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-goto-unblock' ) ); |
372 | 372 | } |
373 | 373 | if( $pagetype != 'GlobalBlockStatus' && $wgUser->isAllowed( 'globalblock-whitelist' ) ) { |
374 | 374 | $title = SpecialPage::getTitleFor( 'GlobalBlockStatus' ); |
375 | | - $links[] = Linker::linkKnown( $title, wfMsg( 'globalblocking-goto-status' ) ); |
| 375 | + $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-goto-status' ) ); |
376 | 376 | } |
377 | 377 | if( $pagetype == 'GlobalBlock' && $wgUser->isAllowed( 'editinterface' ) ) { |
378 | 378 | $title = Title::makeTitle( NS_MEDIAWIKI, 'Globalblocking-block-reason-dropdown' ); |
379 | | - $links[] = Linker::linkKnown( $title, wfMsg( 'globalblocking-block-edit-dropdown' ), array(), array( 'action' => 'edit' ) ); |
| 379 | + $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-block-edit-dropdown' ), array(), array( 'action' => 'edit' ) ); |
380 | 380 | } |
381 | 381 | $linkItems = count( $links ) ? wfMsg( 'parentheses', $wgLang->pipeList( $links ) ) : ''; |
382 | 382 | return $linkItems; |
Index: trunk/extensions/GlobalBlocking/ApiQueryGlobalBlocks.php |
— | — | @@ -83,29 +83,30 @@ |
84 | 84 | } |
85 | 85 | if(isset($params['ip'])) { |
86 | 86 | list($ip, $range) = IP::parseCIDR($params['ip']); |
87 | | - if($ip && $range) { |
| 87 | + if($ip && $range) |
| 88 | + { |
88 | 89 | # We got a CIDR range |
89 | 90 | if($range < 16) |
90 | 91 | $this->dieUsage('CIDR ranges broader than /16 are not accepted', 'cidrtoobroad'); |
91 | 92 | $lower = wfBaseConvert($ip, 10, 16, 8, false); |
92 | 93 | $upper = wfBaseConvert($ip + pow(2, 32 - $range) - 1, 10, 16, 8, false); |
93 | | - } else { |
| 94 | + } |
| 95 | + else |
94 | 96 | $lower = $upper = IP::toHex($params['ip']); |
95 | | - } |
96 | 97 | $prefix = substr($lower, 0, 4); |
97 | | - $this->addWhere( array( |
98 | | - "gb_range_start LIKE '$prefix%'", |
99 | | - "gb_range_start <= '$lower'", |
100 | | - "gb_range_end >= '$upper'" |
101 | | - ) |
102 | | - ); |
| 98 | + $this->addWhere(array( |
| 99 | + "gb_range_start LIKE '$prefix%'", |
| 100 | + "gb_range_start <= '$lower'", |
| 101 | + "gb_range_end >= '$upper'" |
| 102 | + )); |
103 | 103 | } |
104 | 104 | |
105 | 105 | $res = $this->select(__METHOD__); |
106 | 106 | |
107 | 107 | $count = 0; |
108 | 108 | foreach ( $res as $row ) { |
109 | | - if(++$count > $params['limit']) { |
| 109 | + if(++$count > $params['limit']) |
| 110 | + { |
110 | 111 | // We've had enough |
111 | 112 | $this->setContinueEnumParameter('start', wfTimestamp(TS_ISO_8601, $row->gb_timestamp)); |
112 | 113 | break; |
— | — | @@ -113,12 +114,14 @@ |
114 | 115 | $block = array(); |
115 | 116 | if($fld_id) |
116 | 117 | $block['id'] = $row->gb_id; |
117 | | - if($fld_address) { |
| 118 | + if($fld_address) |
| 119 | + { |
118 | 120 | $block['address'] = $row->gb_address; |
119 | 121 | if($row->gb_anon_only) |
120 | 122 | $block['anononly'] = ''; |
121 | 123 | } |
122 | | - if($fld_by) { |
| 124 | + if($fld_by) |
| 125 | + { |
123 | 126 | $block['by'] = $row->gb_by; |
124 | 127 | $block['bywiki'] = $row->gb_by_wiki; |
125 | 128 | } |
— | — | @@ -128,7 +131,8 @@ |
129 | 132 | $block['expiry'] = Block::decodeExpiry($row->gb_expiry, TS_ISO_8601); |
130 | 133 | if($fld_reason) |
131 | 134 | $block['reason'] = $row->gb_reason; |
132 | | - if($fld_range) { |
| 135 | + if($fld_range) |
| 136 | + { |
133 | 137 | $block['rangestart'] = IP::hexToQuad($row->gb_range_start); |
134 | 138 | $block['rangeend'] = IP::hexToQuad($row->gb_range_end); |
135 | 139 | } |
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlockStatus.php |
— | — | @@ -8,33 +8,31 @@ |
9 | 9 | } |
10 | 10 | |
11 | 11 | function execute( $par ) { |
12 | | - global $wgUser; |
| 12 | + global $wgOut, $wgRequest, $wgUser; |
13 | 13 | $this->setHeaders(); |
14 | 14 | |
15 | 15 | $this->loadParameters(); |
16 | 16 | |
17 | | - $out = $this->getOutput(); |
18 | | - $out->setPageTitle( wfMsg( 'globalblocking-whitelist' ) ); |
19 | | - $out->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'GlobalBlockStatus' ) ); |
20 | | - $out->setRobotPolicy( "noindex,nofollow" ); |
21 | | - $out->setArticleRelated( false ); |
22 | | - $out->enableClientCache( false ); |
| 17 | + $wgOut->setPageTitle( wfMsg( 'globalblocking-whitelist' ) ); |
| 18 | + $wgOut->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'GlobalBlockStatus' ) ); |
| 19 | + $wgOut->setRobotPolicy( "noindex,nofollow" ); |
| 20 | + $wgOut->setArticleRelated( false ); |
| 21 | + $wgOut->enableClientCache( false ); |
23 | 22 | |
24 | 23 | if (!$this->userCanExecute( $wgUser )) { |
25 | 24 | $this->displayRestrictionError(); |
26 | 25 | return; |
27 | 26 | } |
28 | | - |
| 27 | + |
29 | 28 | global $wgApplyGlobalBlocks; |
30 | 29 | if (!$wgApplyGlobalBlocks) { |
31 | | - $out->addWikiMsg( 'globalblocking-whitelist-notapplied' ); |
| 30 | + $wgOut->addWikiMsg( 'globalblocking-whitelist-notapplied' ); |
32 | 31 | return; |
33 | 32 | } |
34 | 33 | |
35 | 34 | $errors = ''; |
36 | 35 | |
37 | | - $request = $this->getRequest(); |
38 | | - if ( $request->wasPosted() && $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { |
| 36 | + if ($wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ))) { |
39 | 37 | // They want to submit. Let's have a look. |
40 | 38 | $errors = $this->trySubmit(); |
41 | 39 | if( !$errors ) { |
— | — | @@ -42,11 +40,11 @@ |
43 | 41 | return; |
44 | 42 | } |
45 | 43 | } |
46 | | - |
| 44 | + |
47 | 45 | $errorstr = ''; |
48 | 46 | |
49 | 47 | if (is_array($errors) && count($errors)>0) { |
50 | | - |
| 48 | + |
51 | 49 | foreach ( $errors as $error ) { |
52 | 50 | if (is_array($error)) { |
53 | 51 | $msg = array_shift($error); |
— | — | @@ -59,27 +57,28 @@ |
60 | 58 | |
61 | 59 | $errorstr = wfMsgExt( 'globalblocking-whitelist-errors', array( 'parse' ), array( count( $errors ) ) ) . |
62 | 60 | Xml::tags( 'ul', array( 'class' => 'error' ), $errorstr ); |
63 | | - |
| 61 | + |
64 | 62 | $errorstr = Xml::tags( 'div', array( 'class' => 'error' ), $errorstr ); |
65 | 63 | } |
66 | | - |
| 64 | + |
67 | 65 | $this->form( $errorstr ); |
| 66 | + |
68 | 67 | } |
69 | 68 | |
70 | 69 | function loadParameters() { |
71 | | - $request = $this->getRequest(); |
72 | | - $ip = trim( $request->getText( 'address' ) ); |
73 | | - $this->mAddress = ( $ip !== '' || $request->wasPosted() ) |
| 70 | + global $wgRequest; |
| 71 | + $ip = trim( $wgRequest->getText( 'address' ) ); |
| 72 | + $this->mAddress = ( $ip !== '' || $wgRequest->wasPosted() ) |
74 | 73 | ? Block::normaliseRange( $ip ) |
75 | 74 | : ''; |
76 | | - $this->mReason = $request->getText( 'wpReason' ); |
77 | | - $this->mWhitelistStatus = $request->getCheck( 'wpWhitelistStatus' ); |
78 | | - $this->mEditToken = $request->getText( 'wpEditToken' ); |
79 | | - |
| 75 | + $this->mReason = $wgRequest->getText( 'wpReason' ); |
| 76 | + $this->mWhitelistStatus = $wgRequest->getCheck( 'wpWhitelistStatus' ); |
| 77 | + $this->mEditToken = $wgRequest->getText( 'wpEditToken' ); |
| 78 | + |
80 | 79 | if ( $this->mAddress ) { |
81 | | - $this->mCurrentStatus = ( GlobalBlocking::getWhitelistInfoByIP( $this->mAddress ) !== false); |
82 | | - |
83 | | - if ( !$request->wasPosted() ) { |
| 80 | + $this->mCurrentStatus = (GlobalBlocking::getWhitelistInfoByIP( $this->mAddress ) !== false); |
| 81 | + |
| 82 | + if ( !$wgRequest->wasPosted() ) { |
84 | 83 | $this->mWhitelistStatus = $this->mCurrentStatus; |
85 | 84 | } |
86 | 85 | } else { |
— | — | @@ -88,65 +87,63 @@ |
89 | 88 | } |
90 | 89 | |
91 | 90 | function trySubmit() { |
92 | | - global $wgUser; |
93 | | - |
| 91 | + global $wgOut,$wgUser; |
| 92 | + |
94 | 93 | $ip = $this->mAddress; |
95 | | - |
| 94 | + |
96 | 95 | // Is it blocked? |
97 | 96 | if ( !($id = GlobalBlocking::getGlobalBlockId( $ip ) ) ) { |
98 | 97 | return array( array( 'globalblocking-notblocked', $ip ) ); |
99 | 98 | } |
100 | | - |
| 99 | + |
101 | 100 | $new_status = $this->mWhitelistStatus; |
102 | 101 | $cur_status = $this->mCurrentStatus; |
103 | | - |
| 102 | + |
104 | 103 | // Already whitelisted. |
105 | 104 | if ($cur_status == $new_status) { |
106 | 105 | return array('globalblocking-whitelist-nochange'); |
107 | 106 | } |
108 | 107 | |
109 | 108 | $dbw = wfGetDB( DB_MASTER ); |
110 | | - |
111 | | - $out = $this->getOutput(); |
| 109 | + |
112 | 110 | if ($new_status == true) { |
113 | 111 | $gdbr = GlobalBlocking::getGlobalBlockingSlave(); |
114 | | - |
| 112 | + |
115 | 113 | // Find the expiry of the block. This is important so that we can store it in the |
116 | 114 | // global_block_whitelist table, which allows us to purge it when the block has expired. |
117 | 115 | $expiry = $gdbr->selectField( 'globalblocks', 'gb_expiry', array( 'gb_id' => $id ), __METHOD__ ); |
118 | | - |
| 116 | + |
119 | 117 | $row = array('gbw_by' => $wgUser->getId(), 'gbw_by_text' => $wgUser->getName(), 'gbw_reason' => $this->mReason, 'gbw_address' => $ip, 'gbw_expiry' => $expiry, 'gbw_id' => $id); |
120 | 118 | $dbw->replace( 'global_block_whitelist', array( 'gbw_id' ), $row, __METHOD__ ); |
121 | 119 | |
122 | 120 | $page = new LogPage( 'gblblock' ); |
123 | 121 | $page->addEntry( 'whitelist', Title::makeTitleSafe( NS_USER, $ip ), $this->mReason ); |
124 | | - |
125 | | - $out->addWikiMsg( 'globalblocking-whitelist-whitelisted', $ip, $id ); |
| 122 | + |
| 123 | + $wgOut->addWikiMsg( 'globalblocking-whitelist-whitelisted', $ip, $id ); |
126 | 124 | } else { |
127 | 125 | // Delete the row from the database |
128 | 126 | $dbw->delete( 'global_block_whitelist', array( 'gbw_id' => $id ), __METHOD__ ); |
129 | | - |
| 127 | + |
130 | 128 | $page = new LogPage( 'gblblock' ); |
131 | 129 | $page->addEntry( 'dwhitelist', Title::makeTitleSafe( NS_USER, $ip ), $this->mReason ); |
132 | | - $out->addWikiMsg( 'globalblocking-whitelist-dewhitelisted', $ip, $id ); |
| 130 | + $wgOut->addWikiMsg( 'globalblocking-whitelist-dewhitelisted', $ip, $id ); |
133 | 131 | } |
134 | | - |
| 132 | + |
135 | 133 | $link = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'GlobalBlockList' ), wfMsg( 'globalblocking-return' ) ); |
136 | | - $out->addHTML( $link ); |
| 134 | + $wgOut->addHTML( $link ); |
137 | 135 | |
138 | | - $out->setSubtitle(wfMsg('globalblocking-whitelist-successsub')); |
| 136 | + $wgOut->setSubtitle(wfMsg('globalblocking-whitelist-successsub')); |
139 | 137 | |
140 | 138 | return array(); |
141 | 139 | } |
142 | 140 | |
143 | 141 | function form( $error ) { |
144 | | - global $wgUser; |
| 142 | + global $wgUser, $wgOut; |
| 143 | + |
| 144 | + $wgOut->addWikiMsg( 'globalblocking-whitelist-intro' ); |
| 145 | + |
| 146 | + $wgOut->addHTML( $error ); |
145 | 147 | |
146 | | - $out = $this->getOutput(); |
147 | | - $out->addWikiMsg( 'globalblocking-whitelist-intro' ); |
148 | | - |
149 | | - $out->addHTML( $error ); |
150 | | - |
151 | 148 | $form = ''; |
152 | 149 | $form .= Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, wfMsg( 'globalblocking-whitelist-legend' ) ); |
153 | 150 | $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getFullURL(), 'name' => 'globalblock-whitelist' ) ); |
— | — | @@ -168,6 +165,6 @@ |
169 | 166 | $form .= Xml::closeElement( 'form' ); |
170 | 167 | $form .= Xml::closeElement( 'fieldset' ); |
171 | 168 | |
172 | | - $out->addHTML( $form ); |
| 169 | + $wgOut->addHTML( $form ); |
173 | 170 | } |
174 | 171 | } |
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlockList.php |
— | — | @@ -8,22 +8,23 @@ |
9 | 9 | } |
10 | 10 | |
11 | 11 | function execute( $par ) { |
12 | | - $out = $this->getOutput(); |
| 12 | + global $wgOut, $wgRequest; |
| 13 | + |
13 | 14 | $this->setHeaders(); |
14 | | - $ip = isset( $par ) ? $par : $this->getRequest()->getText( 'ip' ); |
| 15 | + $ip = isset( $par ) ? $par : $wgRequest->getText( 'ip' ); |
15 | 16 | $this->loadParameters( $ip ); |
16 | 17 | |
17 | | - $out->setPageTitle( wfMsg( 'globalblocking-list' ) ); |
18 | | - $out->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'GlobalBlockList' ) ); |
19 | | - $out->setRobotPolicy( "noindex,nofollow" ); |
20 | | - $out->setArticleRelated( false ); |
21 | | - $out->enableClientCache( false ); |
| 18 | + $wgOut->setPageTitle( wfMsg( 'globalblocking-list' ) ); |
| 19 | + $wgOut->setSubtitle( GlobalBlocking::buildSubtitleLinks( 'GlobalBlockList' ) ); |
| 20 | + $wgOut->setRobotPolicy( "noindex,nofollow" ); |
| 21 | + $wgOut->setArticleRelated( false ); |
| 22 | + $wgOut->enableClientCache( false ); |
22 | 23 | |
23 | 24 | $this->showList(); |
24 | 25 | } |
25 | 26 | |
26 | 27 | function showList( ) { |
27 | | - global $wgScript; |
| 28 | + global $wgOut, $wgScript; |
28 | 29 | $errors = array(); |
29 | 30 | |
30 | 31 | // Validate search IP |
— | — | @@ -33,8 +34,8 @@ |
34 | 35 | $ip = ''; |
35 | 36 | } |
36 | 37 | |
37 | | - $out = $this->getOutput(); |
38 | | - $out->addWikiMsg( 'globalblocking-list-intro' ); |
| 38 | + $wgOut->addWikiMsg( 'globalblocking-list-intro' ); |
| 39 | + |
39 | 40 | |
40 | 41 | // Build the search form |
41 | 42 | $searchForm = ''; |
— | — | @@ -45,7 +46,7 @@ |
46 | 47 | |
47 | 48 | if (is_array($errors) && count($errors)>0) { |
48 | 49 | $errorstr = ''; |
49 | | - |
| 50 | + |
50 | 51 | foreach ( $errors as $error ) { |
51 | 52 | if (is_array($error)) { |
52 | 53 | $msg = array_shift($error); |
— | — | @@ -53,12 +54,12 @@ |
54 | 55 | $msg = $error; |
55 | 56 | $error = array(); |
56 | 57 | } |
57 | | - |
| 58 | + |
58 | 59 | $errorstr .= Xml::tags( 'li', null, wfMsgExt( $msg, array( 'parseinline' ), $error ) ); |
59 | 60 | } |
60 | 61 | |
61 | | - $out->addWikiMsg( 'globalblocking-unblock-errors', count($errors) ); |
62 | | - $out->addHTML( Xml::tags( 'ul', array( 'class' => 'error' ), $errorstr ) ); |
| 62 | + $wgOut->addWikiMsg( 'globalblocking-unblock-errors', count($errors) ); |
| 63 | + $wgOut->addHTML( Xml::tags( 'ul', array( 'class' => 'error' ), $errorstr ) ); |
63 | 64 | } |
64 | 65 | |
65 | 66 | $fields = array(); |
— | — | @@ -66,24 +67,24 @@ |
67 | 68 | $searchForm .= Xml::buildForm( $fields, 'globalblocking-search-submit' ); |
68 | 69 | |
69 | 70 | $searchForm .= Xml::closeElement( 'form' ) . Xml::closeElement( 'fieldset' ); |
70 | | - $out->addHTML( $searchForm ); |
| 71 | + $wgOut->addHTML( $searchForm ); |
71 | 72 | |
72 | 73 | // Build a list of blocks. |
73 | 74 | $conds = array(); |
74 | | - |
| 75 | + |
75 | 76 | if (strlen($ip)) { |
76 | 77 | list ($range_start, $range_end) = IP::parseRange( $ip ); |
77 | | - |
| 78 | + |
78 | 79 | if ($range_start != $range_end) { |
79 | 80 | // They searched for a range. Match that exact range only |
80 | 81 | $conds = array( 'gb_address' => $ip ); |
81 | 82 | } else { |
82 | | - // They searched for an IP. Match any range covering that IP |
| 83 | + // They searched for an IP. Match any range covering that IP |
83 | 84 | $hex_ip = IP::toHex( $ip ); |
84 | 85 | $ip_pattern = substr( $hex_ip, 0, 4 ) . '%'; // Don't bother checking blocks out of this /16. |
85 | | - |
| 86 | + |
86 | 87 | $dbr = wfGetDB( DB_SLAVE ); |
87 | | - |
| 88 | + |
88 | 89 | $conds = array( 'gb_range_end>='.$dbr->addQuotes($hex_ip), // This block in the given range. |
89 | 90 | 'gb_range_start<='.$dbr->addQuotes($hex_ip), |
90 | 91 | 'gb_range_start like ' . $dbr->addQuotes( $ip_pattern ), |
— | — | @@ -94,11 +95,11 @@ |
95 | 96 | $pager = new GlobalBlockListPager( $this, $conds ); |
96 | 97 | $body = $pager->getBody(); |
97 | 98 | if( $body != '' ) { |
98 | | - $out->addHTML( $pager->getNavigationBar() . |
| 99 | + $wgOut->addHTML( $pager->getNavigationBar() . |
99 | 100 | Html::rawElement( 'ul', array(), $body ) . |
100 | 101 | $pager->getNavigationBar() ); |
101 | 102 | } else { |
102 | | - $out->wrapWikiMsg( "<div class='mw-globalblocking-noresults'>\n$1</div>\n", |
| 103 | + $wgOut->wrapWikiMsg( "<div class='mw-globalblocking-noresults'>\n$1</div>\n", |
103 | 104 | array( 'globalblocking-list-noresults' ) ); |
104 | 105 | } |
105 | 106 | } |
— | — | @@ -124,12 +125,19 @@ |
125 | 126 | |
126 | 127 | function formatRow( $row ) { |
127 | 128 | global $wgLang, $wgUser; |
128 | | - |
| 129 | + |
| 130 | + ## One-time setup |
| 131 | + static $sk=null; |
| 132 | + |
| 133 | + if (is_null($sk)) { |
| 134 | + $sk = $wgUser->getSkin(); |
| 135 | + } |
| 136 | + |
129 | 137 | ## Setup |
130 | 138 | $timestamp = $row->gb_timestamp; |
131 | 139 | $expiry = $row->gb_expiry; |
132 | 140 | $options = array(); |
133 | | - |
| 141 | + |
134 | 142 | # Messy B/C until $wgLang->formatExpiry() is well embedded |
135 | 143 | if( Block::decodeExpiry( $expiry ) == 'infinity' ){ |
136 | 144 | $options[] = wfMsgExt( 'infiniteblock', 'parseinline' ); |
— | — | @@ -142,24 +150,24 @@ |
143 | 151 | $wgLang->time( $expiry ) |
144 | 152 | ); |
145 | 153 | } |
146 | | - |
| 154 | + |
147 | 155 | # Check for whitelisting. |
148 | 156 | $wlinfo = GlobalBlocking::getWhitelistInfo( $row->gb_id ); |
149 | 157 | if ($wlinfo) { |
150 | 158 | $options[] = wfMsg( 'globalblocking-list-whitelisted', User::whois($wlinfo['user']), $wlinfo['reason'] ); |
151 | 159 | } |
152 | | - |
| 160 | + |
153 | 161 | $timestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $timestamp ), true ); |
154 | 162 | |
155 | 163 | if ($row->gb_anon_only) |
156 | 164 | $options[] = wfMsg('globalblocking-list-anononly'); |
157 | | - |
| 165 | + |
158 | 166 | ## Do afterthoughts (comment, links for admins) |
159 | 167 | $info = array(); |
160 | 168 | |
161 | 169 | if( $wgUser->isAllowed( 'globalunblock' ) ) { |
162 | 170 | $unblockTitle = SpecialPage::getTitleFor( "RemoveGlobalBlock" ); |
163 | | - $info[] = Linker::link( $unblockTitle, |
| 171 | + $info[] = $sk->link( $unblockTitle, |
164 | 172 | wfMsgExt( 'globalblocking-list-unblock', 'parseinline' ), |
165 | 173 | array(), |
166 | 174 | array( 'address' => $row->gb_address ) |
— | — | @@ -169,7 +177,7 @@ |
170 | 178 | global $wgApplyGlobalBlocks; |
171 | 179 | if( $wgUser->isAllowed( 'globalblock-whitelist' ) && $wgApplyGlobalBlocks ) { |
172 | 180 | $whitelistTitle = SpecialPage::getTitleFor( "GlobalBlockStatus" ); |
173 | | - $info[] = Linker::link( $whitelistTitle, |
| 181 | + $info[] = $sk->link( $whitelistTitle, |
174 | 182 | wfMsgExt( 'globalblocking-list-whitelist', 'parseinline' ), |
175 | 183 | array(), |
176 | 184 | array( 'address' => $row->gb_address ) |
— | — | @@ -179,7 +187,7 @@ |
180 | 188 | if ( $wgUser->isAllowed( 'globalblock' ) ) { |
181 | 189 | $reblockTitle = SpecialPage::getTitleFor( 'GlobalBlock' ); |
182 | 190 | $msg = wfMsgExt( 'globalblocking-list-modify', 'parseinline' ); |
183 | | - $info[] = Linker::link( |
| 191 | + $info[] = $sk->link( |
184 | 192 | $reblockTitle, |
185 | 193 | $msg, |
186 | 194 | array(), |
— | — | @@ -201,7 +209,7 @@ |
202 | 210 | $row->gb_address, |
203 | 211 | $wgLang->commaList( $options ) |
204 | 212 | ) . ' ' . |
205 | | - Linker::commentBlock( $row->gb_reason ) . ' ' . |
| 213 | + $sk->commentBlock( $row->gb_reason ) . ' ' . |
206 | 214 | $infoItems |
207 | 215 | ); |
208 | 216 | } |