mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
src build elFinder-2.1-fa2c1f5
This commit is contained in:
@@ -192,6 +192,8 @@ abstract class elFinderVolumeDriver {
|
||||
'icon' => '',
|
||||
// CSS Class of volume root in tree
|
||||
'rootCssClass' => '',
|
||||
// Search timeout (sec)
|
||||
'searchTimeout' => 30,
|
||||
// library to crypt/uncrypt files names (not implemented)
|
||||
'cryptLib' => '',
|
||||
// how to detect files mimetypes. (auto/internal/finfo/mime_content_type)
|
||||
@@ -570,6 +572,14 @@ abstract class elFinderVolumeDriver {
|
||||
*/
|
||||
protected $sessionCache;
|
||||
|
||||
|
||||
/**
|
||||
* Search start time
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $searchStart;
|
||||
|
||||
/*********************************************************************/
|
||||
/* INITIALIZATION */
|
||||
/*********************************************************************/
|
||||
@@ -2129,6 +2139,7 @@ abstract class elFinderVolumeDriver {
|
||||
$q = '';
|
||||
}
|
||||
}
|
||||
$this->searchStart = time();
|
||||
return ($q === '' || $this->commandDisabled('search'))
|
||||
? array()
|
||||
: $this->doSearch(is_null($dir)? $this->root : $dir, $q, $mimes);
|
||||
@@ -3302,9 +3313,22 @@ abstract class elFinderVolumeDriver {
|
||||
**/
|
||||
protected function doSearch($path, $q, $mimes) {
|
||||
$result = array();
|
||||
|
||||
|
||||
$timeout = $this->options['searchTimeout']? $this->searchStart + $this->options['searchTimeout'] : 0;
|
||||
if ($timeout && $timeout < time()) {
|
||||
$this->setError(elFinder::ERROR_SEARCH_TIMEOUT, $this->path($this->encode($path)));
|
||||
return $result;
|
||||
}
|
||||
|
||||
foreach($this->scandirCE($path) as $p) {
|
||||
@set_time_limit(30);
|
||||
@set_time_limit($this->options['searchTimeout'] + 30);
|
||||
|
||||
if ($timeout && ($this->error || $timeout < time())) {
|
||||
!$this->error && $this->setError(elFinder::ERROR_SEARCH_TIMEOUT, $this->path($this->encode($path)));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
$stat = $this->stat($p);
|
||||
|
||||
if (!$stat) { // invalid links
|
||||
|
||||
Reference in New Issue
Block a user