From ab84d1e72151be037f11f707d9bb78db80191402 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 28 Feb 2013 16:31:59 +0100 Subject: [PATCH] Simplify e-Ink detection. --- index.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/index.php b/index.php index 7d19d16..8285a35 100644 --- a/index.php +++ b/index.php @@ -30,20 +30,12 @@ $currentPage->InitializeContent (); /* 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'])) { + if (preg_match("/(Kobo|Kindle\/3.0|EBRD1101)/", $_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'])) { - $isEink = 1; - -/* No Eink screens found */ } else { $isEink = 0; }