r106299 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106298‎ | r106299 | r106300 >
Date:01:29, 15 December 2011
Author:danwe
Status:ok
Tags:
Comment:
Bug fixed where '#arraysearch' would always return '-1' instead of parameter 5 value.
Modified paths:
  • /trunk/extensions/Arrays/Arrays.php (modified) (history)
  • /trunk/extensions/Arrays/RELEASE-NOTES (modified) (history)

Diff [purge]

Index: trunk/extensions/Arrays/RELEASE-NOTES
@@ -6,6 +6,7 @@
77 - '{{#arraydefine: a |}}' will create an empty array instead of an array with an empty element as in
88 version 1.3.2. A new option 'singleempty' can be used to avoid this behavior, ',' can be used to
99 create an array with two empty elements.
 10+ - Bug fixed where '#arraysearch' would always return '-1' instead of parameter 5 value.
1011
1112 * December 5, 2011 -- Version 2.0rc2
1213 - Bug introduced in r105069 fixed where '#arrayprint' was broken in compatibility mode in some cases.
Index: trunk/extensions/Arrays/Arrays.php
@@ -500,12 +500,15 @@
501501 }
502502 }
503503
504 - global $egArraysCompatibilityMode;
505 -
506504 // no match! (Expand only when needed!)
507 - $no = isset( $args[4] )
508 - ? trim( $frame->expand( $args[4] ) )
509 - : $egArraysCompatibilityMode ? '-1' : ''; // COMPATIBILITY-MODE
 505+ if( isset( $args[4] ) ) {
 506+ $no = trim( $frame->expand( $args[4] ) );
 507+ } else {
 508+ global $egArraysCompatibilityMode;
 509+ $no = $egArraysCompatibilityMode
 510+ ? '-1' // COMPATIBILITY-MODE
 511+ : '';
 512+ }
510513 return $no;
511514 }
512515

Status & tagging log