mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
optimize of #542 (initalizes $aroot)
This commit is contained in:
@@ -24,6 +24,13 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
**/
|
||||
protected $archiveSize = 0;
|
||||
|
||||
/**
|
||||
* Canonicalized absolute pathname of $root
|
||||
*
|
||||
* @var strung
|
||||
*/
|
||||
protected $aroot;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Extend options with required fields
|
||||
@@ -264,6 +271,10 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
}
|
||||
|
||||
//Verifies the given path is the root or is inside the root. Prevents directory traveral.
|
||||
if (!$this->aroot) {
|
||||
// for Inheritance class ( not calling parent::configure() )
|
||||
$this->aroot = realpath($this->root);
|
||||
}
|
||||
if (!$this->_inpath(realpath($path), $this->aroot)) {
|
||||
return $stat;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user