Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/php
File: elFinderVolumeSFTPphpseclib.class.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Simple elFinder driver for SFTP using phpseclib 1
[3] Fix | Delete
*
[4] Fix | Delete
* @author Dmitry (dio) Levashov
[5] Fix | Delete
* @author Cem (discofever), sitecode
[6] Fix | Delete
* @reference http://phpseclib.sourceforge.net/sftp/2.0/examples.html
[7] Fix | Delete
**/
[8] Fix | Delete
class elFinderVolumeSFTPphpseclib extends elFinderVolumeFTP {
[9] Fix | Delete
[10] Fix | Delete
/**
[11] Fix | Delete
* Constructor
[12] Fix | Delete
* Extend options with required fields
[13] Fix | Delete
*
[14] Fix | Delete
* @author Dmitry (dio) Levashov
[15] Fix | Delete
* @author Cem (DiscoFever)
[16] Fix | Delete
*/
[17] Fix | Delete
public function __construct()
[18] Fix | Delete
{
[19] Fix | Delete
$opts = array(
[20] Fix | Delete
'host' => 'localhost',
[21] Fix | Delete
'user' => '',
[22] Fix | Delete
'pass' => '',
[23] Fix | Delete
'port' => 22,
[24] Fix | Delete
'path' => '/',
[25] Fix | Delete
'timeout' => 20,
[26] Fix | Delete
'owner' => true,
[27] Fix | Delete
'tmbPath' => '',
[28] Fix | Delete
'tmpPath' => '',
[29] Fix | Delete
'separator' => '/',
[30] Fix | Delete
'phpseclibDir' => '../phpseclib/',
[31] Fix | Delete
'connectCallback' => null, //provide your own already instantiated phpseclib $Sftp object returned by this callback
[32] Fix | Delete
//'connectCallback'=> function($options) {
[33] Fix | Delete
// //load and instantiate phpseclib $sftp
[34] Fix | Delete
// return $sftp;
[35] Fix | Delete
// },
[36] Fix | Delete
'checkSubfolders' => -1,
[37] Fix | Delete
'dirMode' => 0755,
[38] Fix | Delete
'fileMode' => 0644,
[39] Fix | Delete
'rootCssClass' => 'elfinder-navbar-root-ftp',
[40] Fix | Delete
);
[41] Fix | Delete
$this->options = array_merge($this->options, $opts);
[42] Fix | Delete
$this->options['mimeDetect'] = 'internal';
[43] Fix | Delete
}
[44] Fix | Delete
[45] Fix | Delete
/**
[46] Fix | Delete
* Prepare
[47] Fix | Delete
* Call from elFinder::netmout() before volume->mount()
[48] Fix | Delete
*
[49] Fix | Delete
* @param $options
[50] Fix | Delete
*
[51] Fix | Delete
* @return array volume root options
[52] Fix | Delete
* @author Naoki Sawada
[53] Fix | Delete
*/
[54] Fix | Delete
public function netmountPrepare($options)
[55] Fix | Delete
{
[56] Fix | Delete
$options['statOwner'] = true;
[57] Fix | Delete
$options['allowChmodReadOnly'] = true;
[58] Fix | Delete
$options['acceptedName'] = '#^[^/\\?*:|"<>]*[^./\\?*:|"<>]$#';
[59] Fix | Delete
return $options;
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
/*********************************************************************/
[63] Fix | Delete
/* INIT AND CONFIGURE */
[64] Fix | Delete
/*********************************************************************/
[65] Fix | Delete
[66] Fix | Delete
/**
[67] Fix | Delete
* Prepare SFTP connection
[68] Fix | Delete
* Connect to remote server and check if credentials are correct, if so, store the connection
[69] Fix | Delete
*
[70] Fix | Delete
* @return bool
[71] Fix | Delete
* @author Dmitry (dio) Levashov
[72] Fix | Delete
* @author Cem (DiscoFever)
[73] Fix | Delete
**/
[74] Fix | Delete
protected function init()
[75] Fix | Delete
{
[76] Fix | Delete
if (!$this->options['connectCallback']) {
[77] Fix | Delete
if (!$this->options['host']
[78] Fix | Delete
|| !$this->options['port']) {
[79] Fix | Delete
return $this->setError('Required options undefined.');
[80] Fix | Delete
}
[81] Fix | Delete
[82] Fix | Delete
if (!$this->options['path']) {
[83] Fix | Delete
$this->options['path'] = '/';
[84] Fix | Delete
}
[85] Fix | Delete
[86] Fix | Delete
// make net mount key
[87] Fix | Delete
$this->netMountKey = md5(join('-', array('sftpphpseclib', $this->options['host'], $this->options['port'], $this->options['path'], $this->options['user'])));
[88] Fix | Delete
[89] Fix | Delete
set_include_path(get_include_path() . PATH_SEPARATOR . getcwd().'/'.$this->options['phpseclibDir']);
[90] Fix | Delete
include_once('Net/SFTP.php');
[91] Fix | Delete
[92] Fix | Delete
if (!class_exists('Net_SFTP')) {
[93] Fix | Delete
return $this->setError('SFTP extension not loaded. Install phpseclib version 1: http://phpseclib.sourceforge.net/ Set option "phpseclibDir" accordingly.');
[94] Fix | Delete
}
[95] Fix | Delete
[96] Fix | Delete
// remove protocol from host
[97] Fix | Delete
$scheme = parse_url($this->options['host'], PHP_URL_SCHEME);
[98] Fix | Delete
[99] Fix | Delete
if ($scheme) {
[100] Fix | Delete
$this->options['host'] = substr($this->options['host'], strlen($scheme) + 3);
[101] Fix | Delete
}
[102] Fix | Delete
} else {
[103] Fix | Delete
// make net mount key
[104] Fix | Delete
$this->netMountKey = md5(join('-', array('sftpphpseclib', $this->options['path'])));
[105] Fix | Delete
}
[106] Fix | Delete
[107] Fix | Delete
// normalize root path
[108] Fix | Delete
$this->root = $this->options['path'] = $this->_normpath($this->options['path']);
[109] Fix | Delete
[110] Fix | Delete
if (empty($this->options['alias'])) {
[111] Fix | Delete
$this->options['alias'] = $this->options['user'] . '@' . $this->options['host'];
[112] Fix | Delete
if (!empty($this->options['netkey'])) {
[113] Fix | Delete
elFinder::$instance->updateNetVolumeOption($this->options['netkey'], 'alias', $this->options['alias']);
[114] Fix | Delete
}
[115] Fix | Delete
}
[116] Fix | Delete
[117] Fix | Delete
$this->rootName = $this->options['alias'];
[118] Fix | Delete
$this->options['separator'] = '/';
[119] Fix | Delete
[120] Fix | Delete
if (is_null($this->options['syncChkAsTs'])) {
[121] Fix | Delete
$this->options['syncChkAsTs'] = true;
[122] Fix | Delete
}
[123] Fix | Delete
[124] Fix | Delete
return $this->needOnline? $this->connect() : true;
[125] Fix | Delete
[126] Fix | Delete
}
[127] Fix | Delete
[128] Fix | Delete
[129] Fix | Delete
/**
[130] Fix | Delete
* Configure after successfull mount.
[131] Fix | Delete
*
[132] Fix | Delete
* @return void
[133] Fix | Delete
* @throws elFinderAbortException
[134] Fix | Delete
* @author Dmitry (dio) Levashov
[135] Fix | Delete
*/
[136] Fix | Delete
protected function configure()
[137] Fix | Delete
{
[138] Fix | Delete
parent::configure();
[139] Fix | Delete
[140] Fix | Delete
if (!$this->tmp) {
[141] Fix | Delete
$this->disabled[] = 'mkfile';
[142] Fix | Delete
$this->disabled[] = 'paste';
[143] Fix | Delete
$this->disabled[] = 'upload';
[144] Fix | Delete
$this->disabled[] = 'edit';
[145] Fix | Delete
//$this->disabled[] = 'archive';
[146] Fix | Delete
//$this->disabled[] = 'extract';
[147] Fix | Delete
}
[148] Fix | Delete
[149] Fix | Delete
$this->disabled[] = 'archive';
[150] Fix | Delete
$this->disabled[] = 'extract';
[151] Fix | Delete
}
[152] Fix | Delete
[153] Fix | Delete
/**
[154] Fix | Delete
* Connect to sftp server
[155] Fix | Delete
*
[156] Fix | Delete
* @return bool
[157] Fix | Delete
* @author sitecode
[158] Fix | Delete
**/
[159] Fix | Delete
protected function connect()
[160] Fix | Delete
{
[161] Fix | Delete
//use ca
[162] Fix | Delete
if ($this->options['connectCallback']) {
[163] Fix | Delete
$this->connect = $this->options['connectCallback']($this->options);
[164] Fix | Delete
if (!$this->connect || !$this->connect->isConnected()) {
[165] Fix | Delete
return $this->setError('Unable to connect successfully');
[166] Fix | Delete
}
[167] Fix | Delete
[168] Fix | Delete
return true;
[169] Fix | Delete
}
[170] Fix | Delete
[171] Fix | Delete
try{
[172] Fix | Delete
$host = $this->options['host'] . ($this->options['port'] != 22 ? ':' . $this->options['port'] : '');
[173] Fix | Delete
$this->connect = new Net_SFTP($host);
[174] Fix | Delete
//TODO check fingerprint before login, fail if no match to last time
[175] Fix | Delete
if (!$this->connect->login($this->options['user'], $this->options['pass'])) {
[176] Fix | Delete
return $this->setError('Unable to connect to SFTP server ' . $host);
[177] Fix | Delete
}
[178] Fix | Delete
} catch (Exception $e) {
[179] Fix | Delete
return $this->setError('Error while connecting to SFTP server ' . $host . ': ' . $e->getMessage());
[180] Fix | Delete
}
[181] Fix | Delete
[182] Fix | Delete
if (!$this->connect->chdir($this->root)
[183] Fix | Delete
/*|| $this->root != $this->connect->pwd()*/) {
[184] Fix | Delete
//$this->umount();
[185] Fix | Delete
return $this->setError('Unable to open root folder.');
[186] Fix | Delete
}
[187] Fix | Delete
[188] Fix | Delete
return true;
[189] Fix | Delete
}
[190] Fix | Delete
[191] Fix | Delete
/**
[192] Fix | Delete
* Call rawlist
[193] Fix | Delete
*
[194] Fix | Delete
* @param string $path
[195] Fix | Delete
*
[196] Fix | Delete
* @return array
[197] Fix | Delete
*/
[198] Fix | Delete
protected function ftpRawList($path)
[199] Fix | Delete
{
[200] Fix | Delete
return $this->connect->rawlist($path ?: '.') ?: [];
[201] Fix | Delete
}
[202] Fix | Delete
[203] Fix | Delete
/*********************************************************************/
[204] Fix | Delete
/* FS API */
[205] Fix | Delete
/*********************************************************************/
[206] Fix | Delete
[207] Fix | Delete
/**
[208] Fix | Delete
* Close opened connection
[209] Fix | Delete
*
[210] Fix | Delete
* @return void
[211] Fix | Delete
* @author Dmitry (dio) Levashov
[212] Fix | Delete
**/
[213] Fix | Delete
public function umount()
[214] Fix | Delete
{
[215] Fix | Delete
$this->connect && $this->connect->disconnect();
[216] Fix | Delete
}
[217] Fix | Delete
[218] Fix | Delete
[219] Fix | Delete
/**
[220] Fix | Delete
* Parse line from rawlist() output and return file stat (array)
[221] Fix | Delete
*
[222] Fix | Delete
* @param array $info from rawlist() output
[223] Fix | Delete
* @param $base
[224] Fix | Delete
* @param bool $nameOnly
[225] Fix | Delete
*
[226] Fix | Delete
* @return array
[227] Fix | Delete
* @author Dmitry Levashov
[228] Fix | Delete
*/
[229] Fix | Delete
protected function parseRaw($info, $base, $nameOnly = false)
[230] Fix | Delete
{
[231] Fix | Delete
$stat = array();
[232] Fix | Delete
[233] Fix | Delete
if ($info['filename'] == '.' || $info['filename'] == '..') {
[234] Fix | Delete
return false;
[235] Fix | Delete
}
[236] Fix | Delete
[237] Fix | Delete
$name = $info['filename'];
[238] Fix | Delete
[239] Fix | Delete
if ($info['type'] === 3) {
[240] Fix | Delete
// check recursive processing
[241] Fix | Delete
if ($this->cacheDirTarget && $this->_joinPath($base, $name) !== $this->cacheDirTarget) {
[242] Fix | Delete
return array();
[243] Fix | Delete
}
[244] Fix | Delete
if (!$nameOnly) {
[245] Fix | Delete
$target = $this->connect->readlink($name);
[246] Fix | Delete
if (substr($target, 0, 1) !== $this->separator) {
[247] Fix | Delete
$target = $this->getFullPath($target, $base);
[248] Fix | Delete
}
[249] Fix | Delete
$target = $this->_normpath($target);
[250] Fix | Delete
$stat['name'] = $name;
[251] Fix | Delete
$stat['target'] = $target;
[252] Fix | Delete
return $stat;
[253] Fix | Delete
}
[254] Fix | Delete
}
[255] Fix | Delete
[256] Fix | Delete
if ($nameOnly) {
[257] Fix | Delete
return array('name' => $name);
[258] Fix | Delete
}
[259] Fix | Delete
[260] Fix | Delete
$stat['ts'] = $info['mtime'];
[261] Fix | Delete
[262] Fix | Delete
if ($this->options['statOwner']) {
[263] Fix | Delete
$stat['owner'] = $info['uid'];
[264] Fix | Delete
$stat['group'] = $info['gid'];
[265] Fix | Delete
$stat['perm'] = $info['permissions'];
[266] Fix | Delete
$stat['isowner'] = isset($stat['owner']) ? ($this->options['owner'] ? true : ($stat['owner'] == $this->options['user'])) : true;
[267] Fix | Delete
}
[268] Fix | Delete
[269] Fix | Delete
$owner_computed = isset($stat['isowner']) ? $stat['isowner'] : $this->options['owner'];
[270] Fix | Delete
$perm = $this->parsePermissions($info['permissions'], $owner_computed);
[271] Fix | Delete
$stat['name'] = $name;
[272] Fix | Delete
if ($info['type'] === NET_SFTP_TYPE_DIRECTORY) {
[273] Fix | Delete
$stat['mime'] = 'directory';
[274] Fix | Delete
$stat['size'] = 0;
[275] Fix | Delete
[276] Fix | Delete
} elseif ($info['type'] === NET_SFTP_TYPE_SYMLINK) {
[277] Fix | Delete
$stat['mime'] = 'symlink';
[278] Fix | Delete
$stat['size'] = 0;
[279] Fix | Delete
[280] Fix | Delete
} else {
[281] Fix | Delete
$stat['mime'] = $this->mimetype($stat['name'], true);
[282] Fix | Delete
$stat['size'] = $info['size'];
[283] Fix | Delete
}
[284] Fix | Delete
[285] Fix | Delete
$stat['read'] = $perm['read'];
[286] Fix | Delete
$stat['write'] = $perm['write'];
[287] Fix | Delete
[288] Fix | Delete
return $stat;
[289] Fix | Delete
}
[290] Fix | Delete
[291] Fix | Delete
/**
[292] Fix | Delete
* Parse permissions string. Return array(read => true/false, write => true/false)
[293] Fix | Delete
*
[294] Fix | Delete
* @param int $perm
[295] Fix | Delete
* The isowner parameter is computed by the caller.
[296] Fix | Delete
* If the owner parameter in the options is true, the user is the actual owner of all objects even if the user used in the ftp Login
[297] Fix | Delete
* is different from the file owner id.
[298] Fix | Delete
* If the owner parameter is false to understand if the user is the file owner we compare the ftp user with the file owner id.
[299] Fix | Delete
* @param Boolean $isowner . Tell if the current user is the owner of the object.
[300] Fix | Delete
*
[301] Fix | Delete
* @return array
[302] Fix | Delete
* @author Dmitry (dio) Levashov
[303] Fix | Delete
* @author sitecode
[304] Fix | Delete
*/
[305] Fix | Delete
protected function parsePermissions($permissions, $isowner = true)
[306] Fix | Delete
{
[307] Fix | Delete
$permissions = decoct($permissions);
[308] Fix | Delete
$perm = $isowner ? decbin($permissions[-3]) : decbin($permissions[-1]);
[309] Fix | Delete
[310] Fix | Delete
return array(
[311] Fix | Delete
'read' => $perm[-3],
[312] Fix | Delete
'write' => $perm[-2]
[313] Fix | Delete
);
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
/**
[317] Fix | Delete
* Cache dir contents
[318] Fix | Delete
*
[319] Fix | Delete
* @param string $path dir path
[320] Fix | Delete
*
[321] Fix | Delete
* @return void
[322] Fix | Delete
* @author Dmitry Levashov, sitecode
[323] Fix | Delete
**/
[324] Fix | Delete
protected function cacheDir($path)
[325] Fix | Delete
{
[326] Fix | Delete
$this->dirsCache[$path] = array();
[327] Fix | Delete
$hasDir = false;
[328] Fix | Delete
[329] Fix | Delete
$list = array();
[330] Fix | Delete
$encPath = $this->convEncIn($path);
[331] Fix | Delete
foreach ($this->ftpRawList($encPath) as $info) {
[332] Fix | Delete
if (($stat = $this->parseRaw($info, $encPath))) {
[333] Fix | Delete
$list[] = $stat;
[334] Fix | Delete
}
[335] Fix | Delete
}
[336] Fix | Delete
$list = $this->convEncOut($list);
[337] Fix | Delete
$prefix = ($path === $this->separator) ? $this->separator : $path . $this->separator;
[338] Fix | Delete
$targets = array();
[339] Fix | Delete
foreach ($list as $stat) {
[340] Fix | Delete
$p = $prefix . $stat['name'];
[341] Fix | Delete
if (isset($stat['target'])) {
[342] Fix | Delete
// stat later
[343] Fix | Delete
$targets[$stat['name']] = $stat['target'];
[344] Fix | Delete
} else {
[345] Fix | Delete
$stat = $this->updateCache($p, $stat);
[346] Fix | Delete
if (empty($stat['hidden'])) {
[347] Fix | Delete
if (!$hasDir && $stat['mime'] === 'directory') {
[348] Fix | Delete
$hasDir = true;
[349] Fix | Delete
} elseif (!$hasDir && $stat['mime'] === 'symlink') {
[350] Fix | Delete
$hasDir = true;
[351] Fix | Delete
}
[352] Fix | Delete
$this->dirsCache[$path][] = $p;
[353] Fix | Delete
}
[354] Fix | Delete
}
[355] Fix | Delete
}
[356] Fix | Delete
// stat link targets
[357] Fix | Delete
foreach ($targets as $name => $target) {
[358] Fix | Delete
$stat = array();
[359] Fix | Delete
$stat['name'] = $name;
[360] Fix | Delete
$p = $prefix . $name;
[361] Fix | Delete
$cacheDirTarget = $this->cacheDirTarget;
[362] Fix | Delete
$this->cacheDirTarget = $this->convEncIn($target, true);
[363] Fix | Delete
if ($tstat = $this->stat($target)) {
[364] Fix | Delete
$stat['size'] = $tstat['size'];
[365] Fix | Delete
$stat['alias'] = $target;
[366] Fix | Delete
$stat['thash'] = $tstat['hash'];
[367] Fix | Delete
$stat['mime'] = $tstat['mime'];
[368] Fix | Delete
$stat['read'] = $tstat['read'];
[369] Fix | Delete
$stat['write'] = $tstat['write'];
[370] Fix | Delete
[371] Fix | Delete
if (isset($tstat['ts'])) {
[372] Fix | Delete
$stat['ts'] = $tstat['ts'];
[373] Fix | Delete
}
[374] Fix | Delete
if (isset($tstat['owner'])) {
[375] Fix | Delete
$stat['owner'] = $tstat['owner'];
[376] Fix | Delete
}
[377] Fix | Delete
if (isset($tstat['group'])) {
[378] Fix | Delete
$stat['group'] = $tstat['group'];
[379] Fix | Delete
}
[380] Fix | Delete
if (isset($tstat['perm'])) {
[381] Fix | Delete
$stat['perm'] = $tstat['perm'];
[382] Fix | Delete
}
[383] Fix | Delete
if (isset($tstat['isowner'])) {
[384] Fix | Delete
$stat['isowner'] = $tstat['isowner'];
[385] Fix | Delete
}
[386] Fix | Delete
} else {
[387] Fix | Delete
[388] Fix | Delete
$stat['mime'] = 'symlink-broken';
[389] Fix | Delete
$stat['read'] = false;
[390] Fix | Delete
$stat['write'] = false;
[391] Fix | Delete
$stat['size'] = 0;
[392] Fix | Delete
[393] Fix | Delete
}
[394] Fix | Delete
$this->cacheDirTarget = $cacheDirTarget;
[395] Fix | Delete
$stat = $this->updateCache($p, $stat);
[396] Fix | Delete
if (empty($stat['hidden'])) {
[397] Fix | Delete
if (!$hasDir && $stat['mime'] === 'directory') {
[398] Fix | Delete
$hasDir = true;
[399] Fix | Delete
}
[400] Fix | Delete
$this->dirsCache[$path][] = $p;
[401] Fix | Delete
}
[402] Fix | Delete
}
[403] Fix | Delete
[404] Fix | Delete
if (isset($this->sessionCache['subdirs'])) {
[405] Fix | Delete
$this->sessionCache['subdirs'][$path] = $hasDir;
[406] Fix | Delete
}
[407] Fix | Delete
}
[408] Fix | Delete
[409] Fix | Delete
[410] Fix | Delete
/***************** file stat ********************/
[411] Fix | Delete
[412] Fix | Delete
/**
[413] Fix | Delete
* Return stat for given path.
[414] Fix | Delete
* Stat contains following fields:
[415] Fix | Delete
* - (int) size file size in b. required
[416] Fix | Delete
* - (int) ts file modification time in unix time. required
[417] Fix | Delete
* - (string) mime mimetype. required for folders, others - optionally
[418] Fix | Delete
* - (bool) read read permissions. required
[419] Fix | Delete
* - (bool) write write permissions. required
[420] Fix | Delete
* - (bool) locked is object locked. optionally
[421] Fix | Delete
* - (bool) hidden is object hidden. optionally
[422] Fix | Delete
* - (string) alias for symlinks - link target path relative to root path. optionally
[423] Fix | Delete
* - (string) target for symlinks - link target path. optionally
[424] Fix | Delete
* If file does not exists - returns empty array or false.
[425] Fix | Delete
*
[426] Fix | Delete
* @param string $path file path
[427] Fix | Delete
*
[428] Fix | Delete
* @return array|false
[429] Fix | Delete
* @author Dmitry (dio) Levashov
[430] Fix | Delete
**/
[431] Fix | Delete
protected function _stat($path)
[432] Fix | Delete
{
[433] Fix | Delete
$outPath = $this->convEncOut($path);
[434] Fix | Delete
if (isset($this->cache[$outPath])) {
[435] Fix | Delete
return $this->convEncIn($this->cache[$outPath]);
[436] Fix | Delete
} else {
[437] Fix | Delete
$this->convEncIn();
[438] Fix | Delete
}
[439] Fix | Delete
if ($path === $this->root) {
[440] Fix | Delete
$res = array(
[441] Fix | Delete
'name' => $this->root,
[442] Fix | Delete
'mime' => 'directory',
[443] Fix | Delete
'dirs' => -1
[444] Fix | Delete
);
[445] Fix | Delete
if ($this->needOnline && (($this->ARGS['cmd'] === 'open' && $this->ARGS['target'] === $this->encode($this->root)) || $this->isMyReload())) {
[446] Fix | Delete
$check = array(
[447] Fix | Delete
'ts' => true,
[448] Fix | Delete
'dirs' => true,
[449] Fix | Delete
);
[450] Fix | Delete
$ts = 0;
[451] Fix | Delete
foreach ($this->ftpRawList($path) as $info) {
[452] Fix | Delete
if ($info['filename'] === '.') {
[453] Fix | Delete
$info['filename'] = 'root';
[454] Fix | Delete
if ($stat = $this->parseRaw($info, $path)) {
[455] Fix | Delete
unset($stat['name']);
[456] Fix | Delete
$res = array_merge($res, $stat);
[457] Fix | Delete
if ($res['ts']) {
[458] Fix | Delete
$ts = 0;
[459] Fix | Delete
unset($check['ts']);
[460] Fix | Delete
}
[461] Fix | Delete
}
[462] Fix | Delete
}
[463] Fix | Delete
if ($check && ($stat = $this->parseRaw($info, $path))) {
[464] Fix | Delete
if (isset($stat['ts']) && !empty($stat['ts'])) {
[465] Fix | Delete
$ts = max($ts, $stat['ts']);
[466] Fix | Delete
}
[467] Fix | Delete
if (isset($stat['dirs']) && $stat['mime'] === 'directory') {
[468] Fix | Delete
$res['dirs'] = 1;
[469] Fix | Delete
unset($stat['dirs']);
[470] Fix | Delete
}
[471] Fix | Delete
if (!$check) {
[472] Fix | Delete
break;
[473] Fix | Delete
}
[474] Fix | Delete
}
[475] Fix | Delete
}
[476] Fix | Delete
if ($ts) {
[477] Fix | Delete
$res['ts'] = $ts;
[478] Fix | Delete
}
[479] Fix | Delete
$this->cache[$outPath] = $res;
[480] Fix | Delete
}
[481] Fix | Delete
return $res;
[482] Fix | Delete
}
[483] Fix | Delete
[484] Fix | Delete
$pPath = $this->_dirname($path);
[485] Fix | Delete
if ($this->_inPath($pPath, $this->root)) {
[486] Fix | Delete
$outPPpath = $this->convEncOut($pPath);
[487] Fix | Delete
if (!isset($this->dirsCache[$outPPpath])) {
[488] Fix | Delete
$parentSubdirs = null;
[489] Fix | Delete
if (isset($this->sessionCache['subdirs']) && isset($this->sessionCache['subdirs'][$outPPpath])) {
[490] Fix | Delete
$parentSubdirs = $this->sessionCache['subdirs'][$outPPpath];
[491] Fix | Delete
}
[492] Fix | Delete
$this->cacheDir($outPPpath);
[493] Fix | Delete
if ($parentSubdirs) {
[494] Fix | Delete
$this->sessionCache['subdirs'][$outPPpath] = $parentSubdirs;
[495] Fix | Delete
}
[496] Fix | Delete
}
[497] Fix | Delete
}
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function