From fbf947941d5db06c55ad75d45983284dc3276273 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Wed, 24 Aug 2016 12:10:05 -0400 Subject: [PATCH] API: Log when too many values are passed for a multi-valued parameter Currently the API just throws away the excess values, no continuation. This is probably not the best behavior. There is a warning, but clients are notorious for just ignoring warnings. We could improve the situation: * Turn it into an error. * Turn it into an error for most cases, but allow some to override if necessary. * Allow some cases to make it an error, while keeping it a warning by default. Before we can decide which option to pick, we should get an idea of how often this is being hit and which things it's being hit for. Bug: T41936 Change-Id: I52926f410c30d1cd7e7fcd86465b16519fb5cbd2 --- includes/api/ApiBase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index fcb748c202..66c1b530de 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -1171,6 +1171,7 @@ abstract class ApiBase extends ContextSource { : self::LIMIT_SML1; if ( self::truncateArray( $valuesList, $sizeLimit ) ) { + $this->logFeatureUsage( "too-many-$valueName-for-{$this->getModulePath()}" ); $this->setWarning( "Too many values supplied for parameter '$valueName': " . "the limit is $sizeLimit" ); } -- 2.20.1