summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/lib/aurjson.class.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index 7b77da4..debffc4 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']));
}