r106530 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106529‎ | r106530 | r106531 >
Date:21:02, 17 December 2011
Author:catrope
Status:ok
Tags:
Comment:
[RL2] Use array_key_exists() to check for key presence in Gadget::validatePropertiesArray(). Discovered by writing a test suite. Yay testing!
Modified paths:
  • /branches/RL2/extensions/Gadgets/backend/Gadget.php (modified) (history)

Diff [purge]

Index: branches/RL2/extensions/Gadgets/backend/Gadget.php
@@ -103,7 +103,7 @@
104104
105105 // Walk down and verify that the path from the root to this property exists
106106 foreach ( $path as $p ) {
107 - if ( !isset( $val[$p] ) ) {
 107+ if ( !array_key_exists( $p, $val ) ) {
108108 return Status::newFatal( 'gadgets-validate-notset', $property );
109109 }
110110 $val = $val[$p];

Status & tagging log