Skip to content

Commit 7624f97

Browse files
committed
PHP_FLOAT_MIN provides the smallest positive float, not largest negative
1 parent c2f994a commit 7624f97

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/api/database.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@ function createAttribute($collectionId, $attribute, $response, $dbForInternal, $
994994
/** @var Appwrite\Stats\Stats $usage */
995995

996996
// Ensure attribute default is within range
997-
$min = (is_null($min)) ? PHP_FLOAT_MIN : \floatval($min);
997+
$min = (is_null($min)) ? -PHP_FLOAT_MAX : \floatval($min);
998998
$max = (is_null($max)) ? PHP_FLOAT_MAX : \floatval($max);
999999

10001000
if ($min > $max) {

0 commit comments

Comments
 (0)