Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/site/app/models/version.php
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-08-01 05:47:51 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-08-01 05:47:51 (GMT)
commit278355dc6dedd997577c515eac5bfa80adb8f9b8 (patch)
tree61f4acbc6b172e56bd4dd38a91c170ebe358aa6d /site/app/models/version.php
parent70644395c7b42801eb4b2d1436a8b195b4334abc (diff)
Process hulahop version to make SP identification precise on XO
Diffstat (limited to 'site/app/models/version.php')
-rw-r--r--site/app/models/version.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/site/app/models/version.php b/site/app/models/version.php
index 17f9c44..f836e38 100644
--- a/site/app/models/version.php
+++ b/site/app/models/version.php
@@ -137,11 +137,13 @@ class Version extends AppModel
if (!is_array($status)) $status = array($status);
$status_sql = implode(',',$status);
- 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;