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 !
This commit is contained in:
Sébastien Lucas 2013-02-28 16:26:15 +01:00
parent 02c25705cf
commit 15e8372f04

View file

@ -15,6 +15,11 @@
require_once ("customcolumn.php"); require_once ("customcolumn.php");
require_once ("book.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"); header ("Content-Type:application/xhtml+xml");
$page = getURLParam ("page", Base::PAGE_INDEX); $page = getURLParam ("page", Base::PAGE_INDEX);
$query = getURLParam ("query"); $query = getURLParam ("query");