r60008 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60007‎ | r60008 | r60009 >
Date:22:24, 12 December 2009
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Modified paths:
  • /trunk/extensions/Validator/Validator.class.php (modified) (history)
  • /trunk/extensions/Validator/Validator_Settings.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/Validator.class.php
@@ -182,7 +182,7 @@
183183 }
184184
185185 if ( array_key_exists( 'type', $this->parameterInfo[$name] ) ) {
186 - // Add type specific criteria.
 186+ // Add type specific criteria.
187187 switch(strtolower($this->parameterInfo[$name]['type'])) {
188188 case 'integer':
189189 $this->parameterInfo[$name]['criteria']['is_integer'] = array();
@@ -218,10 +218,12 @@
219219 $errors = array();
220220
221221 // Split list types into arrays.
222 - switch(strtolower($this->parameterInfo[$name]['type'])) {
223 - case 'list' : case 'list-string' :
224 - $value = explode($this->parameterInfo[$name]['delimiter'], $value);
225 - break;
 222+ if ( array_key_exists( 'type', $this->parameterInfo[$name] ) ) {
 223+ switch(strtolower($this->parameterInfo[$name]['type'])) {
 224+ case 'list' : case 'list-string' :
 225+ $value = explode($this->parameterInfo[$name]['delimiter'], $value);
 226+ break;
 227+ }
226228 }
227229
228230 // Go through all criteria.
Index: trunk/extensions/Validator/Validator_Settings.php
@@ -18,8 +18,8 @@
1919 }
2020
2121 # Integer. The strictness of the parameter validation and resulting error report when using the ValidatorManager class.
22 -# Validator_ERRORS_NONE : Validator will not show any errors, and make the best of the imput it got.
23 -# Validator_ERRORS_WARN : Validator will make the best of the imput it got, but will show a warning that there are errors.
24 -# Validator_ERRORS_SHOW : Validator will make the best of the imput it got, but will show a list of all errors.
 22+# Validator_ERRORS_NONE : Validator will not show any errors, and make the best of the input it got.
 23+# Validator_ERRORS_WARN : Validator will make the best of the input it got, but will show a warning that there are errors.
 24+# Validator_ERRORS_SHOW : Validator will make the best of the input it got, but will show a list of all errors.
2525 # Validator_ERRORS_STRICT: Validator will only show regular output when there are no errors, if there are, a list of them will be shown.
2626 $egValidatorErrorLevel = Validator_ERRORS_SHOW;

Status & tagging log