protected function _getIosVersion()
{
// First see if we have a newer client that sends the OS version
// Newer iOS sends e.g., "iOS 8.2.2" in OS field.
if (!empty($this->properties[self::OS]) && preg_match('/\\d+\\.\\d+\\.?\\d?/', $this->properties[self::OS], $matches)) {
if (!empty($matches[0])) {
$this->_iOSVersion = $matches[0];
return;
}
}
// Match to a known UserAgent string version.
foreach (Horde_ActiveSync_Device_Ios::$VERSION_MAP as $userAgent => $version) {
if (preg_match('/\\w+\\/(' . $userAgent . ')$/', $this->userAgent, $matches)) {
$this->_iOSVersion = $version;
return;
}
}
}