From b31a9164778f6a2c8b50da03cc020c5ce1576931 Mon Sep 17 00:00:00 2001 From: Matthew Barbour Date: Tue, 11 Jun 2019 09:05:54 -0500 Subject: [PATCH] Changed clamp function to allow null values --- core/polyfills.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/polyfills.php b/core/polyfills.php index 4628e8d7..ffbf31f4 100644 --- a/core/polyfills.php +++ b/core/polyfills.php @@ -508,7 +508,7 @@ function no_escape(string $input): string return $input; } -function clamp(int $val, int $min=null, int $max=null): int +function clamp(?int $val, ?int $min=null, ?int $max=null): int { if (!is_numeric($val) || (!is_null($min) && $val < $min)) { $val = $min;