Fix for #2184 - import script doesnt work when specifying current directory (.).
This commit is contained in:
parent
a105d81743
commit
c18205267e
1 changed files with 12 additions and 3 deletions
|
@ -341,9 +341,18 @@ global $g_fileCount;
|
||||||
global $g_duplicates;
|
global $g_duplicates;
|
||||||
if (is_array($files)) {
|
if (is_array($files)) {
|
||||||
foreach ($files as $filepath) {
|
foreach ($files as $filepath) {
|
||||||
|
// absolute path
|
||||||
|
if (($filepath[0] == "/") || ($filepath[0] == "~")) {
|
||||||
$fullPath = realpath($filepath);
|
$fullPath = realpath($filepath);
|
||||||
if (!$fullPath && !is_null($currentDir)) {
|
} elseif (!is_null($currentDir)) {
|
||||||
$fullPath = "$currentDir/$filepath";
|
$fullPath = realpath("$currentDir/$filepath");
|
||||||
|
} else {
|
||||||
|
$fullPath = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($fullPath)) {
|
||||||
|
echo "ERROR: I cant find the given file: $filepath\n\n";
|
||||||
|
exit;
|
||||||
}
|
}
|
||||||
camp_import_audio_file($fullPath, $importMode, $testonly);
|
camp_import_audio_file($fullPath, $importMode, $testonly);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue