Index: trunk/extensions/Validator/includes/ListParameter.php |
— | — | @@ -112,12 +112,12 @@ |
113 | 113 | */ |
114 | 114 | protected function cleanValue() { |
115 | 115 | $this->value = explode( $this->delimiter, $this->originalValue ); |
116 | | - |
| 116 | + |
117 | 117 | if ( $this->lowerCaseValue ) { |
118 | 118 | foreach ( $this->value as &$item ) { |
119 | 119 | $item = strtolower( $item ); |
120 | 120 | } |
121 | | - } |
| 121 | + } |
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
— | — | @@ -129,7 +129,7 @@ |
130 | 130 | $success = parent::doValidation(); |
131 | 131 | |
132 | 132 | if ( !$success && count( $this->value ) == 0 ) { |
133 | | - $this->value = (array)$this->default; |
| 133 | + $this->value = is_array( $this->default ) ? $this->default : array( $this->default ); |
134 | 134 | } |
135 | 135 | |
136 | 136 | return $success; |
— | — | @@ -196,4 +196,13 @@ |
197 | 197 | return !in_array( $item, $this->tempInvalidList ); |
198 | 198 | } |
199 | 199 | |
| 200 | + /** |
| 201 | + * @see Parameter::setDefault |
| 202 | + * |
| 203 | + * @since 0.4 |
| 204 | + */ |
| 205 | + public function setDefault( $default ) { |
| 206 | + $this->default = is_array( $default ) ? $default : array( $default ); |
| 207 | + } |
| 208 | + |
200 | 209 | } |
\ No newline at end of file |
Index: trunk/extensions/Validator/includes/Parameter.php |
— | — | @@ -430,8 +430,6 @@ |
431 | 431 | } |
432 | 432 | } |
433 | 433 | else { |
434 | | - $this->value = $this->originalValue; |
435 | | - |
436 | 434 | $success = $this->validateCriteria(); |
437 | 435 | } |
438 | 436 | |