From 15e8372f048a54e3b14c5899d0f34e0a01d67891 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 28 Feb 2013 16:26:15 +0100 Subject: [PATCH] Add an automatic redirect if we're coming from an OPDS reader. For information the user agent of Moon+ Reader is : Stanza iPhone/Aldiko/Moon+ Reader(Android) That's really bad ! --- index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.php b/index.php index f6e2384..7d19d16 100644 --- a/index.php +++ b/index.php @@ -15,6 +15,11 @@ require_once ("customcolumn.php"); require_once ("book.php"); + // If we detect that an OPDS reader try to connect try to redirect to feed.php + if (preg_match("/(MantanoReader|FBReader|Stanza|Aldiko|Moon+ Reader)/", $_SERVER['HTTP_USER_AGENT'])) { + header("location: feed.php"); + } + header ("Content-Type:application/xhtml+xml"); $page = getURLParam ("page", Base::PAGE_INDEX); $query = getURLParam ("query");