Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Android devices have 16 character IDs, not 40.

This fixes stats collection on Android.
  • Loading branch information...
commit cf2b32989ece823380a922feb6c362460415e48f 1 parent 7591bee
Fabian Frank FabianFrank authored
Showing with 10 additions and 4 deletions.
  1. +10 −4 server/php/includes/main.php
14 server/php/includes/main.php
View
@@ -211,15 +211,21 @@ protected function validateDir($dir)
protected function addStats($bundleidentifier, $format)
{
// did we get any user data?
- $udid = Router::arg_match(self::PARAM_2_UDID, '/^[0-9a-f]{40}$/i');
+ $osname = Router::arg(self::PARAM_2_OS, 'iOS');
+
+ if ($osname == "Android") {
+ $udid = Router::arg_match(self::PARAM_2_UDID, '/^[0-9a-f]{16}$/i');
+ }
+ else {
+ $udid = Router::arg_match(self::PARAM_2_UDID, '/^[0-9a-f]{40}$/i');
+ }
if (!$udid || !is_dir($this->appDirectory.'stats/')) {
return;
}
-
+
$appversion = Router::arg_variants(array(self::PARAM_2_APP_VERSION, self::PARAM_1_APP_VERSION));
$osversion = Router::arg_variants(array(self::PARAM_2_OS_VERSION, self::PARAM_1_OS_VERSION));
- $osname = Router::arg(self::PARAM_2_OS, 'iOS');
$device = Router::arg_variants(array(self::PARAM_2_DEVICE, self::PARAM_1_DEVICE));
$language = Router::arg(self::PARAM_2_LANGUAGE, '');
$firststartdate = Router::arg(self::PARAM_2_FIRST_START, '');
@@ -649,4 +655,4 @@ protected function sort_versions($a, $b)
}
-?>
+?>
Please sign in to comment.
Something went wrong with that request. Please try again.