summaryrefslogtreecommitdiffstats
path: root/lib/class/catalog.class.php
diff options
context:
space:
mode:
authorPaul Arthur <flowerysong00@yahoo.com>2012-10-18 17:48:14 -0400
committerPaul Arthur <paul.arthur@flowerysong.com>2012-10-18 18:16:30 -0400
commitbea34c42613c10a12b9bd65318de0a799c2db030 (patch)
treeca14de74c7a9addf6fa787da70ee87d94b6c9ff9 /lib/class/catalog.class.php
parent8821554dda12dc6f75b7cdb5985adea184e038a0 (diff)
downloadampache-bea34c42613c10a12b9bd65318de0a799c2db030.tar.gz
ampache-bea34c42613c10a12b9bd65318de0a799c2db030.tar.bz2
ampache-bea34c42613c10a12b9bd65318de0a799c2db030.zip
Fix spurious errors from Catalog::create()
is_readable is flaky under Windows, opendir should be more accurate.
Diffstat (limited to 'lib/class/catalog.class.php')
-rw-r--r--lib/class/catalog.class.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 4dc46c53..9057547b 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -275,9 +275,13 @@ class Catalog extends database_object {
$path = Dba::escape($data['path']);
// Make sure the path is readable/exists
- if (!is_readable($data['path']) AND $data['type'] == 'local') {
- Error::add('general', sprintf(T_('Error: %s is not readable or does not exist'), scrub_out($data['path'])));
- return false;
+ if ($data['type'] == 'local') {
+ $handle = opendir($path);
+ if ($handle === false) {
+ Error::add('general', sprintf(T_('Error: %s is not readable or does not exist'), scrub_out($data['path'])));
+ return false;
+ }
+ closedir($handle);
}
// Make sure this path isn't already in use by an existing catalog