r97489 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97488‎ | r97489 | r97490 >
Date:13:35, 19 September 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
added arg to allow ignoring invalid params rather then going mad at them
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/SMW_QueryProcessor.php
@@ -32,10 +32,11 @@
3333 *
3434 * @param array $params
3535 * @param array $printRequests
 36+ * @param boolean $unknownInvalid
3637 *
3738 * @return array
3839 */
39 - public static function getProcessedParams( array $params, array $printRequests = null ) {
 40+ public static function getProcessedParams( array $params, array $printRequests = null, $unknownInvalid = true ) {
4041 $paramDefinitions = self::getParameters();
4142
4243 $formatManipulation = new SMWParamFormat();
@@ -46,7 +47,7 @@
4748
4849 $paramDefinitions['format']->addManipulations( $formatManipulation );
4950
50 - $validator = new Validator();
 51+ $validator = new Validator( 'SMW query', $unknownInvalid );
5152 $validator->setParameters( $params, $paramDefinitions, false );
5253 $validator->validateParameters();
5354