Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1283,7 +1283,7 @@ |
1284 | 1284 | /** |
1285 | 1285 | * Show an "add new section" link? |
1286 | 1286 | * |
1287 | | - * @return bool True if the parser output instructs us to add one |
| 1287 | + * @return bool |
1288 | 1288 | */ |
1289 | 1289 | public function showNewSectionLink() { |
1290 | 1290 | return $this->mNewSectionLink; |
— | — | @@ -1292,22 +1292,21 @@ |
1293 | 1293 | /** |
1294 | 1294 | * Show a warning about slave lag |
1295 | 1295 | * |
1296 | | - * If the lag is higher than 30 seconds, then the warning is |
1297 | | - * a bit more obvious |
| 1296 | + * If the lag is higher than $wgSlaveLagCritical seconds, |
| 1297 | + * then the warning is a bit more obvious. If the lag is |
| 1298 | + * lower than $wgSlaveLagWarning, then no warning is shown. |
1298 | 1299 | * |
1299 | 1300 | * @param int $lag Slave lag |
1300 | 1301 | */ |
1301 | 1302 | public function showLagWarning( $lag ) { |
1302 | 1303 | global $wgSlaveLagWarning, $wgSlaveLagCritical; |
1303 | | - |
1304 | | - if ($lag < $wgSlaveLagWarning) |
1305 | | - return; |
1306 | | - |
1307 | | - $message = ($lag >= $wgSlaveLagCritical) ? 'lag-warn-high' : 'lag-warn-normal'; |
1308 | | - $warning = wfMsgHtml( $message, htmlspecialchars( $lag ) ); |
1309 | | - $this->addHtml( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" ); |
| 1304 | + if( $lag >= $wgSlaveLagWarning ) { |
| 1305 | + $message = $lag < $wgSlaveLagCritical |
| 1306 | + ? 'lag-warn-normal' |
| 1307 | + : 'lag-warn-high'; |
| 1308 | + $warning = wfMsgExt( $message, 'parse', $lag ); |
| 1309 | + $this->addHtml( "<div class=\"mw-{$message}\">\n{$warning}\n</div>\n" ); |
| 1310 | + } |
1310 | 1311 | } |
1311 | 1312 | |
1312 | | -} |
1313 | | - |
1314 | | - |
| 1313 | +} |
\ No newline at end of file |