Merge branch 'v2.5' of https://github.com/electerious/Lychee into uploader
This commit is contained in:
commit
647367a62d
@ -82,13 +82,16 @@ class Import extends Module {
|
|||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
|
|
||||||
# Prevent index.html from being moved
|
# Prevent unsupported files from being moved
|
||||||
if (basename($file)==='index.html') continue;
|
if (is_dir($file)===false&&@exif_imagetype($file)===false) continue;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
$ret = '';
|
$ret = '';
|
||||||
|
$file = escapeshellarg($file);
|
||||||
|
$cmd = $osmv . " $file " . LYCHEE_DATA . $tmpdirname;
|
||||||
|
|
||||||
|
@exec($cmd, $out, $ret);
|
||||||
|
|
||||||
@exec($osmv . ' ' . $file . ' ' . LYCHEE_DATA . $tmpdirname, $out, $ret);
|
|
||||||
if (isset($ret)&&($ret>0)) Log::error($database, __METHOD__, __LINE__, "Failed to move directory or file ($ret):" . $file);
|
if (isset($ret)&&($ret>0)) Log::error($database, __METHOD__, __LINE__, "Failed to move directory or file ($ret):" . $file);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -116,7 +119,13 @@ class Import extends Module {
|
|||||||
|
|
||||||
if (!isset($path)) $path = LYCHEE_UPLOADS_IMPORT;
|
if (!isset($path)) $path = LYCHEE_UPLOADS_IMPORT;
|
||||||
|
|
||||||
if ($useTemp===true) $path = Import::move($database, $path);
|
if ($useTemp===true) {
|
||||||
|
$path = Import::move($database, $path);
|
||||||
|
if ($path===false) {
|
||||||
|
Log::error($database, __METHOD__, __LINE__, 'Failed to move import to temporary directory');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$error = false;
|
$error = false;
|
||||||
$contains['photos'] = false;
|
$contains['photos'] = false;
|
||||||
|
@ -26,8 +26,18 @@ class Plugins implements \SplSubject {
|
|||||||
|
|
||||||
# Load plugins
|
# Load plugins
|
||||||
foreach ($this->files as $file) {
|
foreach ($this->files as $file) {
|
||||||
|
|
||||||
if ($file==='') continue;
|
if ($file==='') continue;
|
||||||
include(LYCHEE_PLUGINS . $file);
|
|
||||||
|
$file = LYCHEE_PLUGINS . $file;
|
||||||
|
|
||||||
|
if (file_exists($file)===false) {
|
||||||
|
Log::warning($database, __METHOD__, __LINE__, 'Could not include plugin. File does not exist (' . $file . ').');
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
include($file);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user