r72029 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72028‎ | r72029 | r72030 >
Date:16:15, 31 August 2010
Author:nikerabbit
Status:ok
Tags:
Comment:
Update docs and add escaping
Modified paths:
  • /trunk/extensions/Translate/SpecialManageGroups.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/SpecialManageGroups.php
@@ -1,6 +1,6 @@
22 <?php
33 /**
4 - * Implements classes for Special:Translate/manage from where file based message
 4+ * Implements special page for group management, where file based message
55 * groups are be managed.
66 *
77 * @ingroup SpecialPage
@@ -11,23 +11,17 @@
1212 */
1313
1414 /**
15 - * Class for special page Special:Translate/manage. On this special page file
16 - * based message groups can be managed (FileBasedMessageGroup). This page
 15+ * Class for special page Special:ManageMessageGroups. On this special page
 16+ * file based message groups can be managed (FileBasedMessageGroup). This page
1717 * allows updating of the file cache, import and fuzzy for source language
1818 * messages, as well as import/update of messages in other languages.
19 - *
20 - * @todo Needs documentation.
2119 */
2220 class SpecialManageGroups extends SpecialPage {
2321 protected $skin, $user, $out;
24 - /**
25 - * Maximum allowed processing time in seconds.
26 - */
 22+ /// Maximum allowed processing time in seconds.
2723 protected $processingTime = 30;
2824
29 - /**
30 - * Constructor
31 - */
 25+ /// Constructor
3226 public function __construct() {
3327 global $wgOut, $wgUser;
3428 $this->out = $wgOut;
@@ -44,9 +38,6 @@
4539 $group = $wgRequest->getText( 'group' );
4640 $group = MessageGroups::getGroup( $group );
4741
48 - /**
49 - * Only supported for FileBasedMessageGroups.
50 - */
5142 if ( !$group instanceof FileBasedMessageGroup ) {
5243 $group = null;
5344 }
@@ -423,6 +414,7 @@
424415 /**
425416 * Reports if processing time for current page has exceeded the set
426417 * maximum ($processingTime).
 418+ * @return \bool
427419 */
428420 protected function checkProcessTime() {
429421 return wfTimestamp() - $this->time >= $this->processingTime;
@@ -433,7 +425,7 @@
434426 * based on group and language code. The language part is not shown if
435427 * it is 'en', and all three possible parts of the subtitle are linked.
436428 *
437 - * @param $group Object MessageGroup.
 429+ * @param $group MessageGroup
438430 * @param $code \string Language code.
439431 */
440432 protected function setSubtitle( $group, $code ) {
@@ -446,16 +438,17 @@
447439
448440 $links[] = $this->skin->link(
449441 $this->getTitle(),
450 - $group->getLabel(),
 442+ htmlspecialchars( $group->getLabel() ),
451443 array(),
452444 array( 'group' => $group->getId() )
453445 );
454446
455447 // Do not show language part for English.
456448 if ( $code !== 'en' ) {
 449+ $langname = TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() );
457450 $links[] = $this->skin->link(
458451 $this->getTitle(),
459 - TranslateUtils::getLanguageName( $code, false, $wgLang->getCode() ),
 452+ htmlspecialchars( $langname ),
460453 array(),
461454 array( 'group' => $group->getId(), 'language' => $code )
462455 );

Status & tagging log