Fixed detection of absolute path. Add a Windows mapped drive detection.

Reported by Kevnancy
This commit is contained in:
Sébastien Lucas 2013-01-22 09:05:32 +01:00
parent bef7bbf2c3
commit 8cfddc0d11

View file

@ -101,7 +101,9 @@ class Data extends Base {
$textData = "&data=" . $idData; $textData = "&data=" . $idData;
} }
if (preg_match ('/^\//', $config['calibre_directory']) || ($type == "epub" && $config['cops_update_epub-metadata'])) if (preg_match ('/^\//', $config['calibre_directory']) || // Linux /
preg_match ('/^\w\:/', $config['calibre_directory']) || // Windows X:
($type == "epub" && $config['cops_update_epub-metadata']))
{ {
if ($type != "jpg") $textData .= "&type=" . $type; if ($type != "jpg") $textData .= "&type=" . $type;
return new Link ("fetch.php?id=$book->id" . $textData, $mime, $rel, $title); return new Link ("fetch.php?id=$book->id" . $textData, $mime, $rel, $title);