Index: trunk/extensions/GlobalBlocking/SpecialRemoveGlobalBlock.php |
— | — | @@ -8,17 +8,19 @@ |
9 | 9 | } |
10 | 10 | |
11 | 11 | function execute( $par ) { |
12 | | - global $wgOut, $wgRequest, $wgUser; |
| 12 | + global $wgUser; |
13 | 13 | $this->setHeaders(); |
14 | 14 | |
15 | 15 | $this->loadParameters(); |
16 | 16 | |
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 ); |
| 17 | + $out = $this->getOutput(); |
22 | 18 | |
| 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 | + |
23 | 25 | if (!$this->userCanExecute( $wgUser )) { |
24 | 26 | $this->displayRestrictionError(); |
25 | 27 | return; |
— | — | @@ -26,7 +28,8 @@ |
27 | 29 | |
28 | 30 | $errors = ''; |
29 | 31 | |
30 | | - if ($wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ))) { |
| 32 | + $request = $this->getRequest(); |
| 33 | + if ( $request->wasPosted() && $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { |
31 | 34 | // They want to submit. Let's have a look. |
32 | 35 | $errors = $this->trySubmit(); |
33 | 36 | if( !$errors ) { |
— | — | @@ -34,12 +37,12 @@ |
35 | 38 | return; |
36 | 39 | } |
37 | 40 | } |
38 | | - |
39 | | - $wgOut->addWikiMsg( 'globalblocking-unblock-intro' ); |
40 | 41 | |
| 42 | + $out->addWikiMsg( 'globalblocking-unblock-intro' ); |
| 43 | + |
41 | 44 | if (is_array($errors) && count($errors)>0) { |
42 | 45 | $errorstr = ''; |
43 | | - |
| 46 | + |
44 | 47 | foreach ( $errors as $error ) { |
45 | 48 | if (is_array($error)) { |
46 | 49 | $msg = array_shift($error); |
— | — | @@ -49,15 +52,14 @@ |
50 | 53 | } |
51 | 54 | $errorstr .= Xml::tags( 'li', null, wfMsgExt( $msg, array( 'parseinline' ), $error ) ); |
52 | 55 | } |
53 | | - |
| 56 | + |
54 | 57 | $errorstr = Xml::tags( 'ul', array( 'class' => 'error' ), $errorstr ); |
55 | 58 | $errorstr = wfMsgExt( 'globalblocking-unblock-errors', array('parse'), array( count( $errors ) ) ) . $errorstr; |
56 | 59 | $errorstr = Xml::tags( 'div', array( 'class' => 'error' ), $errorstr ); |
57 | | - $wgOut->addHTML( $errorstr ); |
| 60 | + $out->addHTML( $errorstr ); |
58 | 61 | } |
59 | | - |
60 | | - $this->form( ); |
61 | 62 | |
| 63 | + $this->form(); |
62 | 64 | } |
63 | 65 | |
64 | 66 | function loadParameters() { |
— | — | @@ -68,7 +70,7 @@ |
69 | 71 | } |
70 | 72 | |
71 | 73 | function trySubmit() { |
72 | | - global $wgOut,$wgUser; |
| 74 | + global $wgOut; |
73 | 75 | $errors = array(); |
74 | 76 | $ip = $this->mUnblockIP; |
75 | 77 | if (!IP::isIPAddress($ip) && strlen($ip)) { |
— | — | @@ -84,6 +86,7 @@ |
85 | 87 | return $errors; |
86 | 88 | } |
87 | 89 | |
| 90 | + $out = $this->getOutput(); |
88 | 91 | $dbw = GlobalBlocking::getGlobalBlockingMaster(); |
89 | 92 | $dbw->delete( 'globalblocks', array( 'gb_id' => $id ), __METHOD__ ); |
90 | 93 | |
— | — | @@ -91,12 +94,12 @@ |
92 | 95 | $page->addEntry( 'gunblock', Title::makeTitleSafe( NS_USER, $ip ), $this->mReason ); |
93 | 96 | |
94 | 97 | $successmsg = wfMsgExt( 'globalblocking-unblock-unblocked', array( 'parse' ), $ip, $id ); |
95 | | - $wgOut->addHTML( $successmsg ); |
| 98 | + $out->addHTML( $successmsg ); |
96 | 99 | |
97 | | - $link = $wgUser->getSkin()->makeKnownLinkObj( SpecialPage::getTitleFor( 'GlobalBlockList' ), wfMsg( 'globalblocking-return' ) ); |
98 | | - $wgOut->addHTML( $link ); |
| 100 | + $link = Linker::makeKnownLinkObj( SpecialPage::getTitleFor( 'GlobalBlockList' ), wfMsg( 'globalblocking-return' ) ); |
| 101 | + $out->addHTML( $link ); |
99 | 102 | |
100 | | - $wgOut->setSubtitle(wfMsg('globalblocking-unblock-successsub')); |
| 103 | + $out->setSubtitle(wfMsg('globalblocking-unblock-successsub')); |
101 | 104 | |
102 | 105 | return array(); |
103 | 106 | } |
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlock.php |
— | — | @@ -10,16 +10,17 @@ |
11 | 11 | } |
12 | 12 | |
13 | 13 | function execute( $par ) { |
14 | | - global $wgOut, $wgRequest, $wgUser; |
| 14 | + global $wgUser; |
15 | 15 | $this->setHeaders(); |
16 | 16 | |
17 | 17 | $this->loadParameters( $par ); |
18 | 18 | |
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 ); |
| 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 ); |
24 | 25 | |
25 | 26 | if (!$this->userCanExecute( $wgUser )) { |
26 | 27 | $this->displayRestrictionError(); |
— | — | @@ -28,7 +29,8 @@ |
29 | 30 | |
30 | 31 | $errors = ''; |
31 | 32 | |
32 | | - if ($wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ))) { |
| 33 | + $request = $this->getRequest(); |
| 34 | + if ( $request->wasPosted() && $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { |
33 | 35 | // They want to submit. Let's have a look. |
34 | 36 | $errors = $this->trySubmit(); |
35 | 37 | if( !$errors ) { |
— | — | @@ -114,15 +116,14 @@ |
115 | 117 | } |
116 | 118 | |
117 | 119 | function trySubmit() { |
118 | | - global $wgOut, $wgUser; |
119 | 120 | $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(); |
127 | 128 | $reasonstr = $this->mReasonList; |
128 | 129 | if( $reasonstr != 'other' && $this->mReason != '' ) { |
129 | 130 | // Entry from drop down menu + additional comment |
— | — | @@ -145,12 +146,12 @@ |
146 | 147 | $subMessage = 'globalblocking-block-successsub'; |
147 | 148 | } |
148 | 149 | |
149 | | - $wgOut->addWikitext( wfMsg($textMessage, $this->mAddress ) ); |
150 | | - $wgOut->setSubtitle( wfMsg( $subMessage ) ); |
| 150 | + $out->addWikitext( wfMsg($textMessage, $this->mAddress ) ); |
| 151 | + $out->setSubtitle( wfMsg( $subMessage ) ); |
151 | 152 | |
152 | | - $link = $skin->link( SpecialPage::getTitleFor( 'GlobalBlockList' ), |
| 153 | + $link = Linker::link( SpecialPage::getTitleFor( 'GlobalBlockList' ), |
153 | 154 | wfMsg( 'globalblocking-return' ) ); |
154 | | - $wgOut->addHTML( $link ); |
| 155 | + $out->addHTML( $link ); |
155 | 156 | |
156 | 157 | return array(); |
157 | 158 | } |
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 ) ) { return $result; } |
49 | 49 | |
— | — | @@ -55,7 +55,7 @@ |
56 | 56 | // Block has been whitelisted. |
57 | 57 | return $result = array(); |
58 | 58 | } |
59 | | - |
| 59 | + |
60 | 60 | if ( $user->isAllowed( 'ipblock-exempt' ) || $user->isAllowed( 'globalblock-exempt' ) ) { |
61 | 61 | // User is exempt from IP blocks. |
62 | 62 | return $result = array(); |
— | — | @@ -73,10 +73,10 @@ |
74 | 74 | $wgLang->time( $expiry ) |
75 | 75 | ); |
76 | 76 | } |
77 | | - |
| 77 | + |
78 | 78 | $display_wiki = self::getWikiName( $block->gb_by_wiki ); |
79 | 79 | $user_display = self::maybeLinkUserpage( $block->gb_by_wiki, $block->gb_by ); |
80 | | - |
| 80 | + |
81 | 81 | return $result = array( 'globalblocking-blocked', |
82 | 82 | $user_display, $display_wiki, $block->gb_reason, $expiry, $ip ); |
83 | 83 | } |
— | — | @@ -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,6 +342,7 @@ |
343 | 343 | ); |
344 | 344 | return true; |
345 | 345 | } |
| 346 | + |
346 | 347 | /** |
347 | 348 | * Build links to other global blocking special pages, shown in the subtitle |
348 | 349 | * @param string $pagetype The calling special page name |
— | — | @@ -352,30 +353,29 @@ |
353 | 354 | |
354 | 355 | // Add a few useful links |
355 | 356 | $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[] = $sk->linkKnown( $title, wfMsg( 'globalblocklist' ) ); |
| 362 | + $links[] = Linker::linkKnown( $title, wfMsg( 'globalblocklist' ) ); |
363 | 363 | } |
364 | 364 | |
365 | 365 | if( $pagetype != 'GlobalBlock' && $wgUser->isAllowed( 'globalblock' ) ) { |
366 | 366 | $title = SpecialPage::getTitleFor( 'GlobalBlock' ); |
367 | | - $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-goto-block' ) ); |
| 367 | + $links[] = Linker::linkKnown( $title, wfMsg( 'globalblocking-goto-block' ) ); |
368 | 368 | } |
369 | 369 | if( $pagetype != 'RemoveGlobalBlock' && $wgUser->isAllowed( 'globalunblock' ) ) { |
370 | 370 | $title = SpecialPage::getTitleFor( 'RemoveGlobalBlock' ); |
371 | | - $links[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-goto-unblock' ) ); |
| 371 | + $links[] = Linker::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[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-goto-status' ) ); |
| 375 | + $links[] = Linker::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[] = $sk->linkKnown( $title, wfMsg( 'globalblocking-block-edit-dropdown' ), array(), array( 'action' => 'edit' ) ); |
| 379 | + $links[] = Linker::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,30 +83,29 @@ |
84 | 84 | } |
85 | 85 | if(isset($params['ip'])) { |
86 | 86 | list($ip, $range) = IP::parseCIDR($params['ip']); |
87 | | - if($ip && $range) |
88 | | - { |
| 87 | + if($ip && $range) { |
89 | 88 | # We got a CIDR range |
90 | 89 | if($range < 16) |
91 | 90 | $this->dieUsage('CIDR ranges broader than /16 are not accepted', 'cidrtoobroad'); |
92 | 91 | $lower = wfBaseConvert($ip, 10, 16, 8, false); |
93 | 92 | $upper = wfBaseConvert($ip + pow(2, 32 - $range) - 1, 10, 16, 8, false); |
94 | | - } |
95 | | - else |
| 93 | + } else { |
96 | 94 | $lower = $upper = IP::toHex($params['ip']); |
| 95 | + } |
97 | 96 | $prefix = substr($lower, 0, 4); |
98 | | - $this->addWhere(array( |
99 | | - "gb_range_start LIKE '$prefix%'", |
100 | | - "gb_range_start <= '$lower'", |
101 | | - "gb_range_end >= '$upper'" |
102 | | - )); |
| 97 | + $this->addWhere( array( |
| 98 | + "gb_range_start LIKE '$prefix%'", |
| 99 | + "gb_range_start <= '$lower'", |
| 100 | + "gb_range_end >= '$upper'" |
| 101 | + ) |
| 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']) |
110 | | - { |
| 109 | + if(++$count > $params['limit']) { |
111 | 110 | // We've had enough |
112 | 111 | $this->setContinueEnumParameter('start', wfTimestamp(TS_ISO_8601, $row->gb_timestamp)); |
113 | 112 | break; |
— | — | @@ -114,14 +113,12 @@ |
115 | 114 | $block = array(); |
116 | 115 | if($fld_id) |
117 | 116 | $block['id'] = $row->gb_id; |
118 | | - if($fld_address) |
119 | | - { |
| 117 | + if($fld_address) { |
120 | 118 | $block['address'] = $row->gb_address; |
121 | 119 | if($row->gb_anon_only) |
122 | 120 | $block['anononly'] = ''; |
123 | 121 | } |
124 | | - if($fld_by) |
125 | | - { |
| 122 | + if($fld_by) { |
126 | 123 | $block['by'] = $row->gb_by; |
127 | 124 | $block['bywiki'] = $row->gb_by_wiki; |
128 | 125 | } |
— | — | @@ -131,8 +128,7 @@ |
132 | 129 | $block['expiry'] = Block::decodeExpiry($row->gb_expiry, TS_ISO_8601); |
133 | 130 | if($fld_reason) |
134 | 131 | $block['reason'] = $row->gb_reason; |
135 | | - if($fld_range) |
136 | | - { |
| 132 | + if($fld_range) { |
137 | 133 | $block['rangestart'] = IP::hexToQuad($row->gb_range_start); |
138 | 134 | $block['rangeend'] = IP::hexToQuad($row->gb_range_end); |
139 | 135 | } |
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlockStatus.php |
— | — | @@ -8,31 +8,33 @@ |
9 | 9 | } |
10 | 10 | |
11 | 11 | function execute( $par ) { |
12 | | - global $wgOut, $wgRequest, $wgUser; |
| 12 | + global $wgUser; |
13 | 13 | $this->setHeaders(); |
14 | 14 | |
15 | 15 | $this->loadParameters(); |
16 | 16 | |
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 ); |
| 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 ); |
22 | 23 | |
23 | 24 | if (!$this->userCanExecute( $wgUser )) { |
24 | 25 | $this->displayRestrictionError(); |
25 | 26 | return; |
26 | 27 | } |
27 | | - |
| 28 | + |
28 | 29 | global $wgApplyGlobalBlocks; |
29 | 30 | if (!$wgApplyGlobalBlocks) { |
30 | | - $wgOut->addWikiMsg( 'globalblocking-whitelist-notapplied' ); |
| 31 | + $out->addWikiMsg( 'globalblocking-whitelist-notapplied' ); |
31 | 32 | return; |
32 | 33 | } |
33 | 34 | |
34 | 35 | $errors = ''; |
35 | 36 | |
36 | | - if ($wgRequest->wasPosted() && $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ))) { |
| 37 | + $request = $this->getRequest(); |
| 38 | + if ( $request->wasPosted() && $wgUser->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) { |
37 | 39 | // They want to submit. Let's have a look. |
38 | 40 | $errors = $this->trySubmit(); |
39 | 41 | if( !$errors ) { |
— | — | @@ -40,11 +42,11 @@ |
41 | 43 | return; |
42 | 44 | } |
43 | 45 | } |
44 | | - |
| 46 | + |
45 | 47 | $errorstr = ''; |
46 | 48 | |
47 | 49 | if (is_array($errors) && count($errors)>0) { |
48 | | - |
| 50 | + |
49 | 51 | foreach ( $errors as $error ) { |
50 | 52 | if (is_array($error)) { |
51 | 53 | $msg = array_shift($error); |
— | — | @@ -57,28 +59,27 @@ |
58 | 60 | |
59 | 61 | $errorstr = wfMsgExt( 'globalblocking-whitelist-errors', array( 'parse' ), array( count( $errors ) ) ) . |
60 | 62 | Xml::tags( 'ul', array( 'class' => 'error' ), $errorstr ); |
61 | | - |
| 63 | + |
62 | 64 | $errorstr = Xml::tags( 'div', array( 'class' => 'error' ), $errorstr ); |
63 | 65 | } |
64 | | - |
| 66 | + |
65 | 67 | $this->form( $errorstr ); |
66 | | - |
67 | 68 | } |
68 | 69 | |
69 | 70 | function loadParameters() { |
70 | | - global $wgRequest; |
71 | | - $ip = trim( $wgRequest->getText( 'address' ) ); |
72 | | - $this->mAddress = ( $ip !== '' || $wgRequest->wasPosted() ) |
| 71 | + $request = $this->getRequest(); |
| 72 | + $ip = trim( $request->getText( 'address' ) ); |
| 73 | + $this->mAddress = ( $ip !== '' || $request->wasPosted() ) |
73 | 74 | ? Block::normaliseRange( $ip ) |
74 | 75 | : ''; |
75 | | - $this->mReason = $wgRequest->getText( 'wpReason' ); |
76 | | - $this->mWhitelistStatus = $wgRequest->getCheck( 'wpWhitelistStatus' ); |
77 | | - $this->mEditToken = $wgRequest->getText( 'wpEditToken' ); |
78 | | - |
| 76 | + $this->mReason = $request->getText( 'wpReason' ); |
| 77 | + $this->mWhitelistStatus = $request->getCheck( 'wpWhitelistStatus' ); |
| 78 | + $this->mEditToken = $request->getText( 'wpEditToken' ); |
| 79 | + |
79 | 80 | if ( $this->mAddress ) { |
80 | | - $this->mCurrentStatus = (GlobalBlocking::getWhitelistInfoByIP( $this->mAddress ) !== false); |
81 | | - |
82 | | - if ( !$wgRequest->wasPosted() ) { |
| 81 | + $this->mCurrentStatus = ( GlobalBlocking::getWhitelistInfoByIP( $this->mAddress ) !== false); |
| 82 | + |
| 83 | + if ( !$request->wasPosted() ) { |
83 | 84 | $this->mWhitelistStatus = $this->mCurrentStatus; |
84 | 85 | } |
85 | 86 | } else { |
— | — | @@ -87,63 +88,65 @@ |
88 | 89 | } |
89 | 90 | |
90 | 91 | function trySubmit() { |
91 | | - global $wgOut,$wgUser; |
92 | | - |
| 92 | + global $wgUser; |
| 93 | + |
93 | 94 | $ip = $this->mAddress; |
94 | | - |
| 95 | + |
95 | 96 | // Is it blocked? |
96 | 97 | if ( !($id = GlobalBlocking::getGlobalBlockId( $ip ) ) ) { |
97 | 98 | return array( array( 'globalblocking-notblocked', $ip ) ); |
98 | 99 | } |
99 | | - |
| 100 | + |
100 | 101 | $new_status = $this->mWhitelistStatus; |
101 | 102 | $cur_status = $this->mCurrentStatus; |
102 | | - |
| 103 | + |
103 | 104 | // Already whitelisted. |
104 | 105 | if ($cur_status == $new_status) { |
105 | 106 | return array('globalblocking-whitelist-nochange'); |
106 | 107 | } |
107 | 108 | |
108 | 109 | $dbw = wfGetDB( DB_MASTER ); |
109 | | - |
| 110 | + |
| 111 | + $out = $this->getOutput(); |
110 | 112 | if ($new_status == true) { |
111 | 113 | $gdbr = GlobalBlocking::getGlobalBlockingSlave(); |
112 | | - |
| 114 | + |
113 | 115 | // Find the expiry of the block. This is important so that we can store it in the |
114 | 116 | // global_block_whitelist table, which allows us to purge it when the block has expired. |
115 | 117 | $expiry = $gdbr->selectField( 'globalblocks', 'gb_expiry', array( 'gb_id' => $id ), __METHOD__ ); |
116 | | - |
| 118 | + |
117 | 119 | $row = array('gbw_by' => $wgUser->getId(), 'gbw_by_text' => $wgUser->getName(), 'gbw_reason' => $this->mReason, 'gbw_address' => $ip, 'gbw_expiry' => $expiry, 'gbw_id' => $id); |
118 | 120 | $dbw->replace( 'global_block_whitelist', array( 'gbw_id' ), $row, __METHOD__ ); |
119 | 121 | |
120 | 122 | $page = new LogPage( 'gblblock' ); |
121 | 123 | $page->addEntry( 'whitelist', Title::makeTitleSafe( NS_USER, $ip ), $this->mReason ); |
122 | | - |
123 | | - $wgOut->addWikiMsg( 'globalblocking-whitelist-whitelisted', $ip, $id ); |
| 124 | + |
| 125 | + $out->addWikiMsg( 'globalblocking-whitelist-whitelisted', $ip, $id ); |
124 | 126 | } else { |
125 | 127 | // Delete the row from the database |
126 | 128 | $dbw->delete( 'global_block_whitelist', array( 'gbw_id' => $id ), __METHOD__ ); |
127 | | - |
| 129 | + |
128 | 130 | $page = new LogPage( 'gblblock' ); |
129 | 131 | $page->addEntry( 'dwhitelist', Title::makeTitleSafe( NS_USER, $ip ), $this->mReason ); |
130 | | - $wgOut->addWikiMsg( 'globalblocking-whitelist-dewhitelisted', $ip, $id ); |
| 132 | + $out->addWikiMsg( 'globalblocking-whitelist-dewhitelisted', $ip, $id ); |
131 | 133 | } |
132 | | - |
| 134 | + |
133 | 135 | $link = $wgUser->getSkin()->makeKnownLinkObj( SpecialPage::getTitleFor( 'GlobalBlockList' ), wfMsg( 'globalblocking-return' ) ); |
134 | | - $wgOut->addHTML( $link ); |
| 136 | + $out->addHTML( $link ); |
135 | 137 | |
136 | | - $wgOut->setSubtitle(wfMsg('globalblocking-whitelist-successsub')); |
| 138 | + $out->setSubtitle(wfMsg('globalblocking-whitelist-successsub')); |
137 | 139 | |
138 | 140 | return array(); |
139 | 141 | } |
140 | 142 | |
141 | 143 | function form( $error ) { |
142 | | - global $wgUser, $wgOut; |
143 | | - |
144 | | - $wgOut->addWikiMsg( 'globalblocking-whitelist-intro' ); |
145 | | - |
146 | | - $wgOut->addHTML( $error ); |
| 144 | + global $wgUser; |
147 | 145 | |
| 146 | + $out = $this->getOutput(); |
| 147 | + $out->addWikiMsg( 'globalblocking-whitelist-intro' ); |
| 148 | + |
| 149 | + $out->addHTML( $error ); |
| 150 | + |
148 | 151 | $form = ''; |
149 | 152 | $form .= Xml::openElement( 'fieldset' ) . Xml::element( 'legend', null, wfMsg( 'globalblocking-whitelist-legend' ) ); |
150 | 153 | $form .= Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getFullURL(), 'name' => 'globalblock-whitelist' ) ); |
— | — | @@ -165,6 +168,6 @@ |
166 | 169 | $form .= Xml::closeElement( 'form' ); |
167 | 170 | $form .= Xml::closeElement( 'fieldset' ); |
168 | 171 | |
169 | | - $wgOut->addHTML( $form ); |
| 172 | + $out->addHTML( $form ); |
170 | 173 | } |
171 | 174 | } |
Index: trunk/extensions/GlobalBlocking/SpecialGlobalBlockList.php |
— | — | @@ -8,23 +8,22 @@ |
9 | 9 | } |
10 | 10 | |
11 | 11 | function execute( $par ) { |
12 | | - global $wgOut, $wgRequest; |
13 | | - |
| 12 | + $out = $this->getOutput(); |
14 | 13 | $this->setHeaders(); |
15 | | - $ip = isset( $par ) ? $par : $wgRequest->getText( 'ip' ); |
| 14 | + $ip = isset( $par ) ? $par : $this->getRequest()->getText( 'ip' ); |
16 | 15 | $this->loadParameters( $ip ); |
17 | 16 | |
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 ); |
| 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 ); |
23 | 22 | |
24 | 23 | $this->showList(); |
25 | 24 | } |
26 | 25 | |
27 | 26 | function showList( ) { |
28 | | - global $wgOut, $wgScript; |
| 27 | + global $wgScript; |
29 | 28 | $errors = array(); |
30 | 29 | |
31 | 30 | // Validate search IP |
— | — | @@ -34,8 +33,8 @@ |
35 | 34 | $ip = ''; |
36 | 35 | } |
37 | 36 | |
38 | | - $wgOut->addWikiMsg( 'globalblocking-list-intro' ); |
39 | | - |
| 37 | + $out = $this->getOutput(); |
| 38 | + $out->addWikiMsg( 'globalblocking-list-intro' ); |
40 | 39 | |
41 | 40 | // Build the search form |
42 | 41 | $searchForm = ''; |
— | — | @@ -46,7 +45,7 @@ |
47 | 46 | |
48 | 47 | if (is_array($errors) && count($errors)>0) { |
49 | 48 | $errorstr = ''; |
50 | | - |
| 49 | + |
51 | 50 | foreach ( $errors as $error ) { |
52 | 51 | if (is_array($error)) { |
53 | 52 | $msg = array_shift($error); |
— | — | @@ -54,12 +53,12 @@ |
55 | 54 | $msg = $error; |
56 | 55 | $error = array(); |
57 | 56 | } |
58 | | - |
| 57 | + |
59 | 58 | $errorstr .= Xml::tags( 'li', null, wfMsgExt( $msg, array( 'parseinline' ), $error ) ); |
60 | 59 | } |
61 | 60 | |
62 | | - $wgOut->addWikiMsg( 'globalblocking-unblock-errors', count($errors) ); |
63 | | - $wgOut->addHTML( Xml::tags( 'ul', array( 'class' => 'error' ), $errorstr ) ); |
| 61 | + $out->addWikiMsg( 'globalblocking-unblock-errors', count($errors) ); |
| 62 | + $out->addHTML( Xml::tags( 'ul', array( 'class' => 'error' ), $errorstr ) ); |
64 | 63 | } |
65 | 64 | |
66 | 65 | $fields = array(); |
— | — | @@ -67,24 +66,24 @@ |
68 | 67 | $searchForm .= Xml::buildForm( $fields, 'globalblocking-search-submit' ); |
69 | 68 | |
70 | 69 | $searchForm .= Xml::closeElement( 'form' ) . Xml::closeElement( 'fieldset' ); |
71 | | - $wgOut->addHTML( $searchForm ); |
| 70 | + $out->addHTML( $searchForm ); |
72 | 71 | |
73 | 72 | // Build a list of blocks. |
74 | 73 | $conds = array(); |
75 | | - |
| 74 | + |
76 | 75 | if (strlen($ip)) { |
77 | 76 | list ($range_start, $range_end) = IP::parseRange( $ip ); |
78 | | - |
| 77 | + |
79 | 78 | if ($range_start != $range_end) { |
80 | 79 | // They searched for a range. Match that exact range only |
81 | 80 | $conds = array( 'gb_address' => $ip ); |
82 | 81 | } else { |
83 | | - // They searched for an IP. Match any range covering that IP |
| 82 | + // They searched for an IP. Match any range covering that IP |
84 | 83 | $hex_ip = IP::toHex( $ip ); |
85 | 84 | $ip_pattern = substr( $hex_ip, 0, 4 ) . '%'; // Don't bother checking blocks out of this /16. |
86 | | - |
| 85 | + |
87 | 86 | $dbr = wfGetDB( DB_SLAVE ); |
88 | | - |
| 87 | + |
89 | 88 | $conds = array( 'gb_range_end>='.$dbr->addQuotes($hex_ip), // This block in the given range. |
90 | 89 | 'gb_range_start<='.$dbr->addQuotes($hex_ip), |
91 | 90 | 'gb_range_start like ' . $dbr->addQuotes( $ip_pattern ), |
— | — | @@ -95,11 +94,11 @@ |
96 | 95 | $pager = new GlobalBlockListPager( $this, $conds ); |
97 | 96 | $body = $pager->getBody(); |
98 | 97 | if( $body != '' ) { |
99 | | - $wgOut->addHTML( $pager->getNavigationBar() . |
| 98 | + $out->addHTML( $pager->getNavigationBar() . |
100 | 99 | Html::rawElement( 'ul', array(), $body ) . |
101 | 100 | $pager->getNavigationBar() ); |
102 | 101 | } else { |
103 | | - $wgOut->wrapWikiMsg( "<div class='mw-globalblocking-noresults'>\n$1</div>\n", |
| 102 | + $out->wrapWikiMsg( "<div class='mw-globalblocking-noresults'>\n$1</div>\n", |
104 | 103 | array( 'globalblocking-list-noresults' ) ); |
105 | 104 | } |
106 | 105 | } |
— | — | @@ -125,19 +124,12 @@ |
126 | 125 | |
127 | 126 | function formatRow( $row ) { |
128 | 127 | global $wgLang, $wgUser; |
129 | | - |
130 | | - ## One-time setup |
131 | | - static $sk=null; |
132 | | - |
133 | | - if (is_null($sk)) { |
134 | | - $sk = $wgUser->getSkin(); |
135 | | - } |
136 | | - |
| 128 | + |
137 | 129 | ## Setup |
138 | 130 | $timestamp = $row->gb_timestamp; |
139 | 131 | $expiry = $row->gb_expiry; |
140 | 132 | $options = array(); |
141 | | - |
| 133 | + |
142 | 134 | # Messy B/C until $wgLang->formatExpiry() is well embedded |
143 | 135 | if( Block::decodeExpiry( $expiry ) == 'infinity' ){ |
144 | 136 | $options[] = wfMsgExt( 'infiniteblock', 'parseinline' ); |
— | — | @@ -150,24 +142,24 @@ |
151 | 143 | $wgLang->time( $expiry ) |
152 | 144 | ); |
153 | 145 | } |
154 | | - |
| 146 | + |
155 | 147 | # Check for whitelisting. |
156 | 148 | $wlinfo = GlobalBlocking::getWhitelistInfo( $row->gb_id ); |
157 | 149 | if ($wlinfo) { |
158 | 150 | $options[] = wfMsg( 'globalblocking-list-whitelisted', User::whois($wlinfo['user']), $wlinfo['reason'] ); |
159 | 151 | } |
160 | | - |
| 152 | + |
161 | 153 | $timestamp = $wgLang->timeanddate( wfTimestamp( TS_MW, $timestamp ), true ); |
162 | 154 | |
163 | 155 | if ($row->gb_anon_only) |
164 | 156 | $options[] = wfMsg('globalblocking-list-anononly'); |
165 | | - |
| 157 | + |
166 | 158 | ## Do afterthoughts (comment, links for admins) |
167 | 159 | $info = array(); |
168 | 160 | |
169 | 161 | if( $wgUser->isAllowed( 'globalunblock' ) ) { |
170 | 162 | $unblockTitle = SpecialPage::getTitleFor( "RemoveGlobalBlock" ); |
171 | | - $info[] = $sk->link( $unblockTitle, |
| 163 | + $info[] = Linker::link( $unblockTitle, |
172 | 164 | wfMsgExt( 'globalblocking-list-unblock', 'parseinline' ), |
173 | 165 | array(), |
174 | 166 | array( 'address' => $row->gb_address ) |
— | — | @@ -177,7 +169,7 @@ |
178 | 170 | global $wgApplyGlobalBlocks; |
179 | 171 | if( $wgUser->isAllowed( 'globalblock-whitelist' ) && $wgApplyGlobalBlocks ) { |
180 | 172 | $whitelistTitle = SpecialPage::getTitleFor( "GlobalBlockStatus" ); |
181 | | - $info[] = $sk->link( $whitelistTitle, |
| 173 | + $info[] = Linker::link( $whitelistTitle, |
182 | 174 | wfMsgExt( 'globalblocking-list-whitelist', 'parseinline' ), |
183 | 175 | array(), |
184 | 176 | array( 'address' => $row->gb_address ) |
— | — | @@ -187,7 +179,7 @@ |
188 | 180 | if ( $wgUser->isAllowed( 'globalblock' ) ) { |
189 | 181 | $reblockTitle = SpecialPage::getTitleFor( 'GlobalBlock' ); |
190 | 182 | $msg = wfMsgExt( 'globalblocking-list-modify', 'parseinline' ); |
191 | | - $info[] = $sk->link( |
| 183 | + $info[] = Linker::link( |
192 | 184 | $reblockTitle, |
193 | 185 | $msg, |
194 | 186 | array(), |
— | — | @@ -209,7 +201,7 @@ |
210 | 202 | $row->gb_address, |
211 | 203 | $wgLang->commaList( $options ) |
212 | 204 | ) . ' ' . |
213 | | - $sk->commentBlock( $row->gb_reason ) . ' ' . |
| 205 | + Linker::commentBlock( $row->gb_reason ) . ' ' . |
214 | 206 | $infoItems |
215 | 207 | ); |
216 | 208 | } |