mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
checking if attachment or attachment dir exists, before trying to delete it, to quieten warning, also improved warning to be precise if file does not exist, is no directory, or permission missing
This commit is contained in:
parent
907da227e6
commit
201f498a9c
@ -825,12 +825,12 @@ class egw_link extends solink
|
||||
}
|
||||
if (self::DEBUG)
|
||||
{
|
||||
echo "<p>egw_link::delete_attached('$app','$id','$fname') url=$url</p>\n";
|
||||
echo '<p>'.__METHOD__."('$app','$id','$fname') url=$url</p>\n";
|
||||
}
|
||||
if (($Ok = egw_vfs::remove($url,true)) && ((int)$app > 0 || $fname))
|
||||
if (($Ok = !file_exists($url) || egw_vfs::remove($url,true)) && ((int)$app > 0 || $fname))
|
||||
{
|
||||
// try removing the dir, in case it's empty
|
||||
@rmdir(egw_vfs::dirname($url));
|
||||
@egw_vfs::rmdir(egw_vfs::dirname($url));
|
||||
}
|
||||
if (!is_null($current_is_root))
|
||||
{
|
||||
|
@ -681,10 +681,12 @@ class sqlfs_stream_wrapper implements iface_stream_wrapper
|
||||
!egw_vfs::check_access($parent,egw_vfs::WRITABLE))
|
||||
{
|
||||
self::_remove_password($url);
|
||||
if (self::LOG_LEVEL) error_log(__METHOD__."($url,$options) (type=$type) permission denied!");
|
||||
$err_msg = __METHOD__."($url,$options) ".(!$stat ? 'not found!' :
|
||||
($stat['mime'] != self::DIR_MIME_TYPE ? 'not a directory!' : 'permission denied!'));
|
||||
if (self::LOG_LEVEL) error_log($err_msg);
|
||||
if (!($options & STREAM_URL_STAT_QUIET))
|
||||
{
|
||||
trigger_error(__METHOD__."('$url',$options) (type=$type) permission denied!",E_USER_WARNING);
|
||||
trigger_error($err_msg,E_USER_WARNING);
|
||||
}
|
||||
return false; // no permission or file does not exist
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user