Index: trunk/extensions/Validator/includes/Validator.php |
— | — | @@ -61,6 +61,16 @@ |
62 | 62 | */ |
63 | 63 | protected $element; |
64 | 64 | |
| 65 | + /** |
| 66 | + * Indicates if unknown parameters should be seen as invalid. |
| 67 | + * If this value is false, they will simply be ignored. |
| 68 | + * |
| 69 | + * @since 0.4.3 |
| 70 | + * |
| 71 | + * @var boolean |
| 72 | + */ |
| 73 | + protected $unknownInvalid; |
| 74 | + |
65 | 75 | /** |
66 | 76 | * Constructor. |
67 | 77 | * |
— | — | @@ -68,8 +78,9 @@ |
69 | 79 | * |
70 | 80 | * @since 0.4 |
71 | 81 | */ |
72 | | - public function __construct( $element = '' ) { |
| 82 | + public function __construct( $element = '', $unknownInvalid = true ) { |
73 | 83 | $this->element = $element; |
| 84 | + $this->unknownInvalid = $unknownInvalid; |
74 | 85 | } |
75 | 86 | |
76 | 87 | /** |
— | — | @@ -224,7 +235,7 @@ |
225 | 236 | public function validateParameters() { |
226 | 237 | $this->doParamProcessing(); |
227 | 238 | |
228 | | - if ( !$this->hasfatalError() ) { |
| 239 | + if ( !$this->hasFatalError() && $this->unknownInvalid ) { |
229 | 240 | // Loop over the remaining raw parameters. |
230 | 241 | // These are unrecognized parameters, as they where not used by any parameter definition. |
231 | 242 | foreach ( $this->rawParameters as $paramName => $paramValue ) { |
Index: trunk/extensions/Validator/Validator.php |
— | — | @@ -24,7 +24,7 @@ |
25 | 25 | die( 'Not an entry point.' ); |
26 | 26 | } |
27 | 27 | |
28 | | -define( 'Validator_VERSION', '0.4.2' ); |
| 28 | +define( 'Validator_VERSION', '0.4.3 alpha' ); |
29 | 29 | |
30 | 30 | // Register the internationalization file. |
31 | 31 | $wgExtensionMessagesFiles['Validator'] = dirname( __FILE__ ) . '/Validator.i18n.php'; |