r67710 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r67709‎ | r67710 | r67711 >
Date:12:31, 9 June 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fixed one of the issues reported in bug 23849
Modified paths:
  • /trunk/extensions/Validator/Validator.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/Validator.class.php
@@ -223,14 +223,14 @@
224224 if ( !array_key_exists( $mainName, $this->mParameters ) || self::$acceptOverriding ) {
225225 // If the valueis an array, this means it has been procesed in parseAndSetParams already.
226226 // If it is not, setParameters was called directly with an array of string parameter values.
227 - if ( is_array( $paramData ) ) {
 227+ if ( is_array( $paramData ) && array_key_exists( 'original-value', $paramData ) ) {
228228 $paramData['original-name'] = $paramName;
229229 if ( $toLower ) $paramData['original-value'] = strtolower( $paramData['original-value'] );
230230 $this->mParameters[$mainName] = $paramData;
231231 }
232232 else {
233233 $this->mParameters[$mainName] = array(
234 - 'original-value' => $toLower ? strtolower( $paramData ) : $paramData,
 234+ 'original-value' => $toLower && is_string( $paramData ) ? strtolower( $paramData ) : $paramData,
235235 'original-name' => $paramName,
236236 );
237237 }

Status & tagging log