r98893 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98892‎ | r98893 | r98894 >
Date:20:06, 4 October 2011
Author:reedy
Status:resolved (Comments)
Tags:
Comment:
Fix some undefined, or potentially undefined variables

Left 1 fixme in pagetranslation-check-database.php as couldn't see an obvious source
Modified paths:
  • /trunk/extensions/Translate/MessageGroups.php (modified) (history)
  • /trunk/extensions/Translate/ffs/Gettext.php (modified) (history)
  • /trunk/extensions/Translate/scripts/pagetranslation-check-database.php (modified) (history)
  • /trunk/extensions/Translate/utils/JsSelectToInput.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/pagetranslation-check-database.php
@@ -138,7 +138,7 @@
139139 array( 'delete tag', 'revtag', array( 'rt_page' => $id, 'rt_type' => $_->rt_type ) );
140140 continue;
141141 } elseif ( $_->rt_type === RevTag::getType( 'tp:transver' ) ) {
142 - $check = $this->checkTransrevRevision( $rev );
 142+ $check = $this->checkTransrevRevision( $rev ); // FIXME: $rev is undefined
143143 if ( $check !== true ) {
144144 $name = $this->idToName( $_->rt_page );
145145 $this->output( "Page $name has invalid tp:transver: $check\n" );
Index: trunk/extensions/Translate/MessageGroups.php
@@ -1075,6 +1075,7 @@
10761076 }
10771077 natcasesort( $labels );
10781078
 1079+ $sorted = array();
10791080 foreach ( array_keys( $labels ) as $id ) {
10801081 $sorted[$id] = $structure[$id];
10811082 }
Index: trunk/extensions/Translate/utils/JsSelectToInput.php
@@ -72,8 +72,8 @@
7373 */
7474 public function getHtmlAndPrepareJS() {
7575 if ( $this->sourceId === false ) {
76 - if ( is_callable( array( $select, 'getAttribute' ) ) ) {
77 - $this->sourceId = $select->getAttribute['id'];
 76+ if ( is_callable( array( $this->select, 'getAttribute' ) ) ) {
 77+ $this->sourceId = $this->->getAttribute['id'];
7878 }
7979
8080 if ( !$this->sourceId ) {
Index: trunk/extensions/Translate/ffs/Gettext.php
@@ -85,6 +85,9 @@
8686 throw new MWException( "Gettext file header was not found:\n\n$data" );
8787 }
8888
 89+ $template = array();
 90+ $messages = array();
 91+
8992 // Extract some metadata from headers for easier use
9093 $metadata = array();
9194 if ( isset( $headers['X-Language-Code'] ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r98895Fix syntax error from r98893reedy20:14, 4 October 2011

Comments

#Comment by Nikerabbit (talk | contribs)   22:17, 4 October 2011

Filed the fixme as bug 31357 for myself.

Status & tagging log