mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-03 17:59:21 +02:00
Fix spurious errors from Catalog::create()
is_readable is flaky under Windows, opendir should be more accurate.
This commit is contained in:
parent
8821554dda
commit
bea34c4261
2 changed files with 12 additions and 3 deletions
|
@ -2,6 +2,11 @@
|
|||
--------- Ampache -- CHANGELOG ---------
|
||||
--------------------------------------------------------------------------
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
v.3.6-future
|
||||
- Fixed an issue with adding catalogs on Windows caused by inconsistent
|
||||
behaviour of is_readable() (reported by Lockzi)
|
||||
|
||||
--------------------------------------------------------------------------
|
||||
v.3.6-Alpha3 2012-10-15
|
||||
- Updated getID3 to 1.9.4b1
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue