Simplify e-Ink detection.
这个提交存在于:
父节点
15e8372f04
当前提交
ab84d1e721
共有 1 个文件被更改,包括 4 次插入 和 12 次删除
14
index.php
14
index.php
|
|
@ -30,20 +30,12 @@
|
||||||
$currentPage->InitializeContent ();
|
$currentPage->InitializeContent ();
|
||||||
|
|
||||||
/* Test to see if pages are opened on an Eink screen
|
/* Test to see if pages are opened on an Eink screen
|
||||||
* First test Kindle or Kobo Touch */
|
* test Kindle, Kobo Touch and Sony PRS-T1 Ereader.
|
||||||
|
* HTTP_USER_AGENT = "Mozilla/5.0 (Linux; U; en-us; EBRD1101; EXT) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
|
||||||
if (preg_match("/(Kobo|Kindle\/3.0)/", $_SERVER['HTTP_USER_AGENT'])) {
|
|
||||||
$isEink = 1;
|
|
||||||
|
|
||||||
/* Test Sony PRS-T1 Ereader.
|
|
||||||
HTTP_USER_AGENT = "Mozilla/5.0 (Linux; U; en-us; EBRD1101; EXT) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1"
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
} else if (preg_match("/EBRD1101/i", $_SERVER['HTTP_USER_AGENT'])) {
|
if (preg_match("/(Kobo|Kindle\/3.0|EBRD1101)/", $_SERVER['HTTP_USER_AGENT'])) {
|
||||||
$isEink = 1;
|
$isEink = 1;
|
||||||
|
|
||||||
/* No Eink screens found */
|
|
||||||
} else {
|
} else {
|
||||||
$isEink = 0;
|
$isEink = 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
正在加载…
添加表格
添加链接
在新工单中引用