http://www.mediawiki.org/wiki/Special:Code/MediaWiki/73786
Revision: 73786
Author: jeroendedauw
Date: 2010-09-26 18:12:59 +0000 (Sun, 26 Sep 2010)
Log Message:
-----------
Changes for 0.4 - fixed small issues
Modified Paths:
--------------
trunk/extensions/Validator/includes/ListParameter.php
trunk/extensions/Validator/includes/Parameter.php
Modified: trunk/extensions/Validator/includes/ListParameter.php
===================================================================
--- trunk/extensions/Validator/includes/ListParameter.php 2010-09-26
17:48:30 UTC (rev 73785)
+++ trunk/extensions/Validator/includes/ListParameter.php 2010-09-26
18:12:59 UTC (rev 73786)
@@ -112,12 +112,12 @@
*/
protected function cleanValue() {
$this->value = explode( $this->delimiter, $this->originalValue
);
-
+
if ( $this->lowerCaseValue ) {
foreach ( $this->value as &$item ) {
$item = strtolower( $item );
}
- }
+ }
}
/**
@@ -129,7 +129,7 @@
$success = parent::doValidation();
if ( !$success && count( $this->value ) == 0 ) {
- $this->value = (array)$this->default;
+ $this->value = is_array( $this->default ) ?
$this->default : array( $this->default );
}
return $success;
@@ -196,4 +196,13 @@
return !in_array( $item, $this->tempInvalidList );
}
+ /**
+ * @see Parameter::setDefault
+ *
+ * @since 0.4
+ */
+ public function setDefault( $default ) {
+ $this->default = is_array( $default ) ? $default : array(
$default );
+ }
+
}
\ No newline at end of file
Modified: trunk/extensions/Validator/includes/Parameter.php
===================================================================
--- trunk/extensions/Validator/includes/Parameter.php 2010-09-26 17:48:30 UTC
(rev 73785)
+++ trunk/extensions/Validator/includes/Parameter.php 2010-09-26 18:12:59 UTC
(rev 73786)
@@ -430,8 +430,6 @@
}
}
else {
- $this->value = $this->originalValue;
-
$success = $this->validateCriteria();
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs