From c18205267e893c34594fab8303f8ec9b1ea6e052 Mon Sep 17 00:00:00 2001 From: paul Date: Tue, 13 Feb 2007 16:58:24 +0000 Subject: [PATCH] Fix for #2184 - import script doesnt work when specifying current directory (.). --- .../storageAdmin/var/campcaster-import.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/campcaster/src/modules/storageAdmin/var/campcaster-import.php b/campcaster/src/modules/storageAdmin/var/campcaster-import.php index 91833c907..10d5624ed 100644 --- a/campcaster/src/modules/storageAdmin/var/campcaster-import.php +++ b/campcaster/src/modules/storageAdmin/var/campcaster-import.php @@ -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); }