r52764 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52763‎ | r52764 | r52765 >
Date:08:12, 4 July 2009
Author:ialex
Status:deferred
Tags:
Comment:
* removed calls to wfLoadExtensionMessages()
* replaced some makeKnownLinkObj by linkKnown
* escape 'configure-old-changes' message (was passed raw to the output) and user names when the change was made on another wiki
Modified paths:
  • /trunk/extensions/Configure/Configure.diff.php (modified) (history)
  • /trunk/extensions/Configure/Configure.func.php (modified) (history)
  • /trunk/extensions/Configure/Configure.page.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Configure/Configure.page.php
@@ -17,7 +17,6 @@
1818 * Constructor
1919 */
2020 public function __construct( $name, $right ) {
21 - wfLoadExtensionMessages( 'Configure' );
2221 $this->mConfSettings = ConfigurationSettings::singleton( $this->getSettingMask() );
2322 # Reload data WITHOUT CACHE
2423 global $wgConf;
@@ -379,22 +378,23 @@
380379 foreach ( $versions as $data ) {
381380 $ts = $data['timestamp'];
382381 $count++;
383 - $link = $skin->makeKnownLinkObj( $title, $wgLang->timeAndDate( $ts ), "version=$ts" );
 382+ $link = $skin->linkKnown( $title, $wgLang->timeAndDate( $ts ), array(), array( 'version' => $ts ) );
384383 $diffLink = '';
385384 if ( $prev )
386 - $diffLink = '(' . $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'ViewConfig' ), wfMsg( 'configure-old-changes' ), "version=$ts&diff=$prev" ) . ')';
 385+ $diffLink = '(' . $skin->linkKnown( SpecialPage::getTitleFor( 'ViewConfig' ),
 386+ wfMsgHtml( 'configure-old-changes' ), array(), array( 'version' => $ts, 'diff' => $prev ) ) . ')';
387387
388388 ## Make user link...
389389 $userLink = '';
390390 if( !$data['userwiki'] || !$data['username'] ) {
391391 $userLink = '';
392392 } else if ( $data['userwiki'] == wfWikiId() ) {
393 - $userLink = $skin->link( Title::makeTitle( NS_USER, $data['username'] ), $data['username'] );
394 - } elseif ( class_exists( 'WikiMap' ) && ($wiki = WikiMap::getWiki( $data['userwiki'] ) ) ) {
395 - $userLink = $skin->makeExternalLink( $wiki->getUrl( 'User:'.$data['username'] ), $data['username'].'@'.$data['userwiki'] );
 393+ $userLink = $skin->link( Title::makeTitle( NS_USER, $data['username'] ), htmlspecialchars( $data['username'] ) );
 394+ } elseif ( $wiki = WikiMap::getWiki( $data['userwiki'] ) ) {
 395+ $userLink = $skin->makeExternalLink( $wiki->getUrl( 'User:'.$data['username'] ), htmlspecialchars( $data['username'].'@'.$data['userwiki'] ) );
396396 } else {
397397 ## Last-ditch
398 - $userLink = $data['username'].'@'.$data['userwiki'];
 398+ $userLink = htmlspecialchars( $data['username'].'@'.$data['userwiki'] );
399399 }
400400
401401 $comment = $data['reason'] ? $skin->commentBlock( $data['reason'] ) : '';
@@ -875,7 +875,7 @@
876876 protected function buildSearchForm() {
877877 $form = wfMsgExt( 'configure-js-search-prompt', 'parseinline' ) . wfMsgExt( 'word-separator', array( 'escapenoentities' ) ) .
878878 Xml::element( 'input', array( 'id' => 'configure-search-input', 'size' => 45 ) );
879 - $form = Xml::tags( 'p', null, $form ) . "\n" . Xml::openElement( 'ul', array('id' => 'configure-search-results') ) . '</ul>';
 879+ $form = Xml::tags( 'p', null, $form ) . "\n" . Xml::openElement( 'ul', array( 'id' => 'configure-search-results' ) ) . '</ul>';
880880 $form = Xml::fieldset( wfMsg( 'configure-js-search-legend' ), $form, array( 'style' => 'display: none;', 'id' => 'configure-search-form' ) );
881881 return $form;
882882 }
@@ -1498,8 +1498,6 @@
14991499 * @return xhtml
15001500 */
15011501 protected function buildSettings( $settings, $param = array() ) {
1502 - wfLoadExtensionMessages( 'ConfigureSettings' );
1503 -
15041502 global $wgConf;
15051503 $defaults = $wgConf->getDefaultsForWiki( $this->mWiki );
15061504
Index: trunk/extensions/Configure/Configure.diff.php
@@ -189,8 +189,6 @@
190190 * @return String: XHTML
191191 */
192192 function processDiffSetting( $name, $old, $new, $type ) {
193 - wfLoadExtensionMessages( 'ConfigureSettings' );
194 -
195193 $msg = 'configure-setting-' . $name;
196194 $msgVal = wfMsgExt( $msg, array( 'parseinline' ) );
197195 $rawVal = Xml::element( 'tt', null, "\$$name" );
Index: trunk/extensions/Configure/Configure.func.php
@@ -25,7 +25,6 @@
2626 if ( $settings->getSettingType( $setting ) != 'array' )
2727 return '<err#>';
2828
29 - wfLoadExtensionMessages( 'Configure' );
3029 $type = $settings->getArrayType( $setting );
3130 switch( $type ) {
3231 case 'group-bool':
@@ -141,7 +140,6 @@
142141 function efConfigureFarmerAdminExtensions( $farmer ) {
143142 global $wgOut;
144143
145 - wfLoadExtensionMessages( 'Configure' );
146144 $wgOut->wrapWikiMsg( '== $1 ==', 'farmer-extensions' );
147145 $wgOut->addWikiMsg( 'configure-farmer-extensions' );
148146
@@ -154,7 +152,6 @@
155153 function efConfigureFarmerManageExtensions( $farmer ) {
156154 global $wgOut;
157155
158 - wfLoadExtensionMessages( 'Configure' );
159156 $wgOut->wrapWikiMsg( '== $1 ==', 'farmer-extensions-available' );
160157 $wgOut->addWikiMsg( 'configure-farmer-extensions-list' );
161158

Status & tagging log