diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-11-14 03:26:03 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-11-14 03:26:03 +0300 |
commit | e66c3d52a9e9564374d65732d19a2cec5d65bf2e (patch) | |
tree | 58c8837df6390c6567c0705222cba0fb5ee6f118 /core/Tracker/Request.php | |
parent | 03d1687c49860afbf7aa056d983c442d5f0203b5 (diff) |
refs #6661 also return a HTTP 400 in case there is another invalid request param
Diffstat (limited to 'core/Tracker/Request.php')
-rw-r--r-- | core/Tracker/Request.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/Tracker/Request.php b/core/Tracker/Request.php index 110d0eb65d..efc3f331d9 100644 --- a/core/Tracker/Request.php +++ b/core/Tracker/Request.php @@ -12,6 +12,8 @@ use Exception; use Piwik\Common; use Piwik\Config; use Piwik\Cookie; +use Piwik\Exception\InvalidRequestParameterException; +use Piwik\Exception\InvalidVisitorIdException; use Piwik\Exception\UnexpectedWebsiteFoundException; use Piwik\IP; use Piwik\Network\IPUtils; @@ -304,7 +306,7 @@ class Request ); if (!isset($supportedParams[$name])) { - throw new Exception("Requested parameter $name is not a known Tracking API Parameter."); + throw new InvalidRequestParameterException("Requested parameter $name is not a known Tracking API Parameter."); } $paramDefaultValue = $supportedParams[$name][0]; @@ -524,7 +526,7 @@ class Request $idVisitor = $this->getForcedVisitorId(); if (!empty($idVisitor)) { if (strlen($idVisitor) != Tracker::LENGTH_HEX_ID_STRING) { - throw new Exception("Visitor ID (cid) $idVisitor must be " . Tracker::LENGTH_HEX_ID_STRING . " characters long"); + throw new InvalidRequestParameterException("Visitor ID (cid) $idVisitor must be " . Tracker::LENGTH_HEX_ID_STRING . " characters long"); } Common::printDebug("Request will be recorded for this idvisitor = " . $idVisitor); $found = true; |