diff options
-rw-r--r-- | web/lib/aurjson.class.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php index 7b77da46..debffc46 100644 --- a/web/lib/aurjson.class.php +++ b/web/lib/aurjson.class.php @@ -45,6 +45,9 @@ class AurJSON { 'ID', 'PackageBaseID', 'NumVotes', 'OutOfDate', 'FirstSubmitted', 'LastModified' ); + private static $decimal_fields = array( + 'Popularity' + ); /* * Handles post data, and routes the request. @@ -255,6 +258,10 @@ class AurJSON { $row[$field] = intval($row[$field]); } + foreach (self::$decimal_fields as $field) { + $row[$field] = floatval($row[$field]); + } + if ($this->version >= 2 && ($type == 'info' || $type == 'multiinfo')) { $row = array_merge($row, $this->get_extended_fields($row['ID'])); } |