mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
[php] fix #2014 "Parse error" on PHP < 5.3
This commit is contained in:
@@ -82,8 +82,9 @@ elFinder::$netDrivers['ftp'] = 'FTP';
|
||||
* @return bool|null
|
||||
**/
|
||||
function access($attr, $path, $data, $volume, $isDir, $relpath) {
|
||||
return basename($path)[0] === '.' // if file/folder begins with '.' (dot) with out volume root
|
||||
&& strlen($relpath) !== 1
|
||||
$basename = basename($path);
|
||||
return $basename[0] === '.' // if file/folder begins with '.' (dot)
|
||||
&& strlen($relpath) !== 1 // but with out volume root
|
||||
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
|
||||
: null; // else elFinder decide it itself
|
||||
}
|
||||
|
||||
@@ -249,9 +249,11 @@ class elFinderSimpleLogger {
|
||||
* @return bool|null
|
||||
**/
|
||||
function access($attr, $path, $data, $volume, $isDir) {
|
||||
return strpos(basename($path), '.') === 0 // if file/folder begins with '.' (dot)
|
||||
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
|
||||
: null; // else elFinder decide it itself
|
||||
$basename = basename($path);
|
||||
return $basename[0] === '.' // if file/folder begins with '.' (dot)
|
||||
&& strlen($relpath) !== 1 // but with out volume root
|
||||
? !($attr == 'read' || $attr == 'write') // set read+write to false, other (locked+hidden) set to true
|
||||
: null; // else elFinder decide it itself
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1084,7 +1084,7 @@ class elFinderVolumeBox extends elFinderVolumeDriver
|
||||
protected function getSharedWebContentLink($raw)
|
||||
{
|
||||
$fExtension = pathinfo($raw->name, PATHINFO_EXTENSION);
|
||||
$fType = explode('/', self::mimetypeInternalDetect($raw->name))[0];
|
||||
list($fType) = explode('/', self::mimetypeInternalDetect($raw->name));
|
||||
|
||||
if ($raw->shared_link->url && ($fType == 'image' || $fType == 'video' || $fType == 'audio')) {
|
||||
if ($fExtension == 'jpg' && $fType == 'image') {
|
||||
|
||||
Reference in New Issue
Block a user