diff --git a/CRM/Report/Utils/Get.php b/CRM/Report/Utils/Get.php index 8669159425a..21005661f3f 100644 --- a/CRM/Report/Utils/Get.php +++ b/CRM/Report/Utils/Get.php @@ -66,9 +66,12 @@ public static function dateParam($fieldName, &$field, &$defaults) { $from = self::getTypedValue("{$fieldName}_from", $type); $to = self::getTypedValue("{$fieldName}_to", $type); - $relative = CRM_Utils_Array::value("{$fieldName}_relative", $_GET); + $relative = self::getTypedValue("{$fieldName}_relative", CRM_Utils_Type::T_STRING); + if ($relative !== NULL) { + $defaults["{$fieldName}_relative"] = $relative; + } if ($relative) { - list($from, $to) = CRM_Report_Form::getFromTo($relative, NULL, NULL); + list($from, $to) = CRM_Utils_Date::getFromTo($relative, NULL, NULL); $from = substr($from, 0, 8); $to = substr($to, 0, 8); }