r90252 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r90251‎ | r90252 | r90253 >
Date:02:14, 17 June 2011
Author:yaron
Status:deferred
Tags:
Comment:
Added array_key_exists() checks, to prevent PHP notices
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormPrinter.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormPrinter.php
@@ -119,9 +119,17 @@
120120
121121 public function getDefaultInputType( $isList, $propertyType ) {
122122 if ( $isList ) {
123 - return $this->mDefaultInputForPropTypeList[$propertyType];
 123+ if ( array_key_exists( $propertyType, $this->mDefaultInputForPropTypeList ) ) {
 124+ return $this->mDefaultInputForPropTypeList[$propertyType];
 125+ } else {
 126+ return null;
 127+ }
124128 } else {
125 - return $this->mDefaultInputForPropType[$propertyType];
 129+ if ( array_key_exists( $propertyType, $this->mDefaultInputForPropType ) ) {
 130+ return $this->mDefaultInputForPropType[$propertyType];
 131+ } else {
 132+ return null;
 133+ }
126134 }
127135 }
128136