Simplify a little getLink
This commit is contained in:
parent
133b6dc9d6
commit
e67e620ba3
7
base.php
7
base.php
|
@ -1072,6 +1072,13 @@ abstract class Base
|
||||||
return is_array ($config['calibre_directory']);
|
return is_array ($config['calibre_directory']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function useAbsolutePath () {
|
||||||
|
global $config;
|
||||||
|
$path = self::getDbDirectory();
|
||||||
|
return preg_match ('/^\//', Base::getDbDirectory ()) || // Linux /
|
||||||
|
preg_match ('/^\w\:/', Base::getDbDirectory ()); // Windows X:
|
||||||
|
}
|
||||||
|
|
||||||
public static function noDatabaseSelected () {
|
public static function noDatabaseSelected () {
|
||||||
return self::isMultipleDatabaseEnabled () && is_null (GetUrlParam (DB));
|
return self::isMultipleDatabaseEnabled () && is_null (GetUrlParam (DB));
|
||||||
}
|
}
|
||||||
|
|
3
data.php
3
data.php
|
@ -150,8 +150,7 @@ class Data extends Base {
|
||||||
|
|
||||||
$urlParam = addURLParameter("", "data", $idData);
|
$urlParam = addURLParameter("", "data", $idData);
|
||||||
|
|
||||||
if (preg_match ('/^\//', Base::getDbDirectory ()) || // Linux /
|
if (Base::useAbsolutePath () ||
|
||||||
preg_match ('/^\w\:/', Base::getDbDirectory ()) || // Windows X:
|
|
||||||
$rel == Link::OPDS_THUMBNAIL_TYPE ||
|
$rel == Link::OPDS_THUMBNAIL_TYPE ||
|
||||||
($type == "epub" && $config['cops_update_epub-metadata']))
|
($type == "epub" && $config['cops_update_epub-metadata']))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue