r47599 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47598‎ | r47599 | r47600 >
Date:08:26, 21 February 2009
Author:nad
Status:resolved (Comments)
Tags:
Comment:
Only call $wgLang->pipeList if $wgVersion >= 1.14.0
Modified paths:
  • /trunk/extensions/RecordAdmin/RecordAdmin_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RecordAdmin/RecordAdmin_body.php
@@ -23,7 +23,7 @@
2424 * Override SpecialPage::execute()
2525 */
2626 function execute( $param ) {
27 - global $wgOut, $wgRequest, $wgRecordAdminUseNamespaces, $wgLang;
 27+ global $wgVersion, $wgOut, $wgRequest, $wgRecordAdminUseNamespaces, $wgLang;
2828 $this->setHeaders();
2929 $type = $wgRequest->getText( 'wpType' ) or $type = $param;
3030 $record = $wgRequest->getText( 'wpRecord' );
@@ -35,11 +35,18 @@
3636 if ( $wpTitle && !ereg( "^$type:.+$", $wpTitle ) ) $wpTitle = "$type:$wpTitle";
3737 }
3838
39 - $wgOut->addHTML( $wgLang->pipeList( array(
40 - "<div class='center'><a href='" . $title->getLocalURL() . "/$type'>" . wfMsg( 'recordadmin-newsearch', $type ) . "</a>",
41 - "<a href='" . $title->getLocalURL() . "'>" . wfMsg( 'recordadmin-newrecord' ) . "</a></div><br>\n"
42 - ) ) );
43 -
 39+ if (version_compare($wgVersion, '1.14.0') >= 0) {
 40+ $wgOut->addHTML( $wgLang->pipeList( array(
 41+ "<div class='center'><a href='" . $title->getLocalURL() . "/$type'>" . wfMsg( 'recordadmin-newsearch', $type ) . "</a>",
 42+ "<a href='" . $title->getLocalURL() . "'>" . wfMsg( 'recordadmin-newrecord' ) . "</a></div><br>\n"
 43+ ) ) );
 44+ }
 45+ else {
 46+ $wgOut->addHTML( "<div class='center'><a href='" . $title->getLocalURL() . "/$type'>" . wfMsg( 'recordadmin-newsearch', $type ) . "</a> | "
 47+ . "<a href='" . $title->getLocalURL() . "'>" . wfMsg( 'recordadmin-newrecord' ) . "</a></div><br>\n"
 48+ );
 49+ }
 50+
4451 # Get posted form values if any
4552 $posted = array();
4653 foreach ( $_POST as $k => $v ) if ( ereg( '^ra_(.+)$', $k, $m ) ) $posted[$m[1]] = $v;

Comments

#Comment by Siebrand (talk | contribs)   10:44, 21 February 2009

Fixed in r47600.

Status & tagging log