[VD:LocalFileSystem] fix #3543 Can't download folder in PHP 8.1

This commit is contained in:
nao-pon
2023-06-02 16:49:54 +09:00
parent 6088461757
commit 28a04a419a
+8 -6
View File
@@ -972,7 +972,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver
**/
protected function _symlink($source, $targetDir, $name)
{
return symlink($source, $this->_joinPath($targetDir, $name));
return $this->localFileSystemSymlink($source, $this->_joinPath($targetDir, $name));
}
/**
@@ -1470,12 +1470,14 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver
protected function localFileSystemSymlink($target, $link)
{
$res = false;
$errlev = error_reporting();
error_reporting($errlev ^ E_WARNING);
if ($res = symlink(realpath($target), $link)) {
$res = is_readable($link);
if (function_exists('symlink') and is_callable('symlink')) {
$errlev = error_reporting();
error_reporting($errlev ^ E_WARNING);
if ($res = symlink(realpath($target), $link)) {
$res = is_readable($link);
}
error_reporting($errlev);
}
error_reporting($errlev);
return $res;
}
} // END class