From 8ae17a2d8a4c57bc387f65aacf8c14043349ade2 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 14 Feb 2020 09:18:34 +1300 Subject: [PATCH] Allow any casting done in Type::validate to bubble up to Request::retrieveValue The validate function returns - NULL if the passed in value is not valid - THe passed in value if valid or - The passed in value cast to an integer if the value is valid and the type is Int or Integer By always using the returned value we allow it to be cast, where appropriate --- CRM/Utils/Request.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CRM/Utils/Request.php b/CRM/Utils/Request.php index 4b5d89fbcd..731e43ffaf 100644 --- a/CRM/Utils/Request.php +++ b/CRM/Utils/Request.php @@ -88,10 +88,8 @@ class CRM_Utils_Request { break; } - if (isset($value) && - (CRM_Utils_Type::validate($value, $type, $abort, $name) === NULL) - ) { - $value = NULL; + if (isset($value)) { + $value = CRM_Utils_Type::validate($value, $type, $abort, $name); } if (!isset($value) && $store) { -- 2.25.1