зеркало из https://github.com/mozilla/pjs.git
Added appOS back in to prevent regressions. Since appOS is in the URL the cache should be different per OS, but UA guessing is still pointless and will be deprecated.
This commit is contained in:
Родитель
60c16a5479
Коммит
af9606e154
|
@ -215,6 +215,16 @@ function get_os_id()
|
|||
'solaris'=>6
|
||||
);
|
||||
|
||||
// Check $_GET for a match.
|
||||
if (!empty($_GET['appOS']) && ctype_alpha($_GET['appOS'])) {
|
||||
$appOS = strtolower($_GET['appOS']);
|
||||
foreach ($os as $string=>$id) {
|
||||
if ($appOS == $string) {
|
||||
return $id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check UA string for a match
|
||||
foreach ($os as $string=>$id) {
|
||||
if (preg_match("/^.*{$string}.*$/i",$_SERVER['HTTP_USER_AGENT'])) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче