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.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/site/app/models/file.php b/site/app/models/file.php
index 4a49f97..64b4e74 100644
--- a/site/app/models/file.php
+++ b/site/app/models/file.php
@@ -85,11 +85,13 @@ class File extends AppModel
// Platform WHERE if necessary
$platform = !empty($platform_id) ? " AND (File.platform_id = ".PLATFORM_ALL." OR File.platform_id = {$platform_id})" : '';
- if (preg_match('/OLPC\//', $_SERVER['HTTP_USER_AGENT']))
- $sp = 0.82;
- else {
- preg_match('/Sugar Labs\/([^\s]*)/', $_SERVER['HTTP_USER_AGENT'], $matches);
- if (isset($matches[1]))
+ if (preg_match('/OLPC\/0\.([^-]*)-/', $_SERVER['HTTP_USER_AGENT'], $matches)) {
+ if (floatval($matches[1]) <= 4.6)
+ $sp = 0.82;
+ else
+ $sp = 0.84;
+ } else {
+ if (preg_match('/Sugar Labs\/([^\s]*)/', $_SERVER['HTTP_USER_AGENT'], $matches))
$sp = floatval($matches[1]);
else
$sp = 0.84;