Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/models/file.php
diff options
context:
space:
mode:
Diffstat (limited to 'site/app/models/file.php')
-rw-r--r--site/app/models/file.php13
1 files changed, 1 insertions, 12 deletions
diff --git a/site/app/models/file.php b/site/app/models/file.php
index 1041f5d..dc02aaa 100644
--- a/site/app/models/file.php
+++ b/site/app/models/file.php
@@ -85,18 +85,7 @@ class File extends AppModel
function getLatestFileByAddonId($addon_id, $platform_id = null) {
// Platform WHERE if necessary
$platform = !empty($platform_id) ? " AND (File.platform_id = ".PLATFORM_ALL." OR File.platform_id = {$platform_id})" : '';
-
- if (preg_match('/OLPC\/0\.([^-]*)-/', env('HTTP_USER_AGENT'), $matches)) {
- if (floatval($matches[1]) <= 4.6)
- $sp = '0.82';
- else
- $sp = '0.84';
- } else {
- if (preg_match('/Sugar Labs\/([0-9]+)\.([0-9]+)/', env('HTTP_USER_AGENT'), $matches))
- $sp = $matches[1].'.'.$matches[2];
- else
- $sp = SITE_SUGAR_STABLE;
- }
+ $sp = parse_sp();
$sql = "
SELECT