diff --git a/.htaccess b/.htaccess index 89f503a..9a18ad1 100644 --- a/.htaccess +++ b/.htaccess @@ -15,10 +15,17 @@ DirectoryIndex index.php ########################################### # On WAMP one user had to add this line in his httpd.conf -# None of the abose was working +# None of the above was working ########################################### #XSendFilePath +########################################### +# If you want to use user based configuration with +# apache 2.4 + php-fpm enable this +# https://github.com/seblucas/cops/issues/213 +########################################### +#SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 + RewriteEngine on RewriteRule ^download/(\d*)/(\d*)/.*\.kepub\.epub$ fetch.php?data=$1&db=$2&type=epub [L] diff --git a/README b/README index c8f2504..da7314d 100644 --- a/README +++ b/README @@ -39,6 +39,9 @@ If you want to use the OPDS feed don't forget to specify feed.php at the end of On any Debian base Linux you can use : aptitude install php5-gd php5-sqlite php5-json +On Centos you may have to add : + yum install php-xml + = Install = 1. Extract the zip file to a folder in web space (visible to the web server). diff --git a/base.php b/base.php index 4f28d87..cd5257a 100644 --- a/base.php +++ b/base.php @@ -1201,6 +1201,9 @@ abstract class Base global $config; if (self::isMultipleDatabaseEnabled ()) { if (is_null ($database)) $database = GetUrlParam (DB, 0); + if (!is_null($database) && !preg_match('/^\d+$/', $database)) { + return self::error ($database); + } $array = array_keys ($config['calibre_directory']); return $array[$database]; } @@ -1211,6 +1214,9 @@ abstract class Base global $config; if (self::isMultipleDatabaseEnabled ()) { if (is_null ($database)) $database = GetUrlParam (DB, 0); + if (!is_null($database) && !preg_match('/^\d+$/', $database)) { + return self::error ($database); + } $array = array_values ($config['calibre_directory']); return $array[$database]; } @@ -1222,11 +1228,11 @@ abstract class Base return self::getDbDirectory ($database) .'metadata.db'; } - private static function error () { + private static function error ($database) { if (php_sapi_name() != "cli") { header("location: checkconfig.php?err=1"); } - throw new Exception('Database not found.'); + throw new Exception("Database <{$database}> not found."); } public static function getDb ($database = NULL) { @@ -1238,10 +1244,10 @@ abstract class Base self::$db->sqliteCreateFunction ('normAndUp', 'normAndUp', 1); } } else { - self::error (); + self::error ($database); } } catch (Exception $e) { - self::error (); + self::error ($database); } } return self::$db; diff --git a/lang/Localization_nl.json b/lang/Localization_nl.json index 011949c..7f78b24 100644 --- a/lang/Localization_nl.json +++ b/lang/Localization_nl.json @@ -17,12 +17,12 @@ "bookword.one":"1 boek", "bookword.title":"Boeken", "cog.alternate":"Zoeken, sorteren en filters", -"content.series":"Series:", -"content.series.data":"Boek {0} in de {1} serie", +"content.series":"Reeksen:", +"content.series.data":"Boek {0} in de {1} reeks", "content.summary":"Samenvatting", "customize.email":"E-mailadres ontvanger (om boeken te versturen per elektronische post)", "customize.fancybox":"Gebruik een Lightbox", -"customize.filter":"Zet filteren op tag aan", +"customize.filter":"Zet filteren op label aan", "customize.ignored":"Niet opgenomen categorieën", "customize.paging":"Maximaal aantal boeken per pagina (-1 voor oneindig aantal)", "customize.style":"Opmaak COPS gebruikersomgeving", @@ -62,28 +62,28 @@ "search.result.author":"Zoekresultaat voor *{0}* in auteurs", "search.result.book":"Zoekresultaat voor *{0}* in boeken", "search.result.publisher":"Zoekresultaat voor *{0}* in uitgevers", -"search.result.series":"Zoekresultaat voor *{0}* in series", -"search.result.tag":"Zoekresultaat voor *{0}* in tags", +"search.result.series":"Zoekresultaat voor *{0}* in reeksen", +"search.result.tag":"Zoekresultaat voor *{0}* in labels", "search.sortorder.asc":"A-Z", "search.sortorder.desc":"Z-A", -"series.alphabetical.many":"Alfabetische index van {0} series", -"series.alphabetical.none":"Alfabetische index van absoluut geen enkele serie", -"series.alphabetical.one":"Alfabetische index van 1 serie", -"series.title":"Series", -"seriesword.many":"{0} series", -"seriesword.none":"Geen series", -"seriesword.one":"1 serie", +"series.alphabetical.many":"Alfabetische index van {0} reeksen", +"series.alphabetical.none":"Alfabetische index van absoluut geen enkele reeks", +"series.alphabetical.one":"Alfabetische index van 1 reeks", +"series.title":"Reeksen", +"seriesword.many":"{0} reeksen", +"seriesword.none":"Geen reeks", +"seriesword.one":"1 reeks", "sort.alternate":"Sorteren", "splitByLetter.book.other":"Andere boeken", "splitByLetter.letter":"{0} beginnend met {1}", -"tags.alphabetical.many":"Alfabetische index van {0} tags", -"tags.alphabetical.none":"Alfabetische index van absoluut geen enkele tag", -"tags.alphabetical.one":"Alfabetische index van 1 tag", -"tags.title":"Tags", -"tagword.many":"{0} tags", -"tagword.none":"Geen tag", -"tagword.one":"1 tag", -"tagword.title":"Tags", +"tags.alphabetical.many":"Alfabetische index van {0} labels", +"tags.alphabetical.none":"Alfabetische index van absoluut geen enkele label", +"tags.alphabetical.one":"Alfabetische index van 1 label", +"tags.title":"Labels", +"tagword.many":"{0} labels", +"tagword.none":"Geen label", +"tagword.one":"1 label", +"tagword.title":"Labels", "languages.abk":"Abchazisch", "languages.aaf":"Afar", "languages.afr":"Afrikaans",