Fix for #2184 - import script doesnt work when specifying current directory (.).

This commit is contained in:
paul 2007-02-13 16:58:24 +00:00
parent a105d81743
commit c18205267e
1 changed files with 12 additions and 3 deletions

View File

@ -341,9 +341,18 @@ global $g_fileCount;
global $g_duplicates;
if (is_array($files)) {
foreach ($files as $filepath) {
$fullPath = realpath($filepath);
if (!$fullPath && !is_null($currentDir)) {
$fullPath = "$currentDir/$filepath";
// absolute path
if (($filepath[0] == "/") || ($filepath[0] == "~")) {
$fullPath = realpath($filepath);
} elseif (!is_null($currentDir)) {
$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);
}