Edit File by line
/home/barbar84/www/wp-conte.../plugins/worker/src/PHPSecLi.../Net
File: SFTP.php
$result = strcasecmp($a['filename'], $b['filename']);
[1000] Fix | Delete
if ($result) {
[1001] Fix | Delete
return $order === SORT_DESC ? -$result : $result;
[1002] Fix | Delete
}
[1003] Fix | Delete
break;
[1004] Fix | Delete
case 'permissions':
[1005] Fix | Delete
case 'mode':
[1006] Fix | Delete
$a[$sort] &= 07777;
[1007] Fix | Delete
$b[$sort] &= 07777;
[1008] Fix | Delete
default:
[1009] Fix | Delete
if ($a[$sort] === $b[$sort]) {
[1010] Fix | Delete
break;
[1011] Fix | Delete
}
[1012] Fix | Delete
[1013] Fix | Delete
return $order === SORT_ASC ? $a[$sort] - $b[$sort] : $b[$sort] - $a[$sort];
[1014] Fix | Delete
}
[1015] Fix | Delete
}
[1016] Fix | Delete
}
[1017] Fix | Delete
[1018] Fix | Delete
/**
[1019] Fix | Delete
* Defines how nlist() and rawlist() will be sorted - if at all.
[1020] Fix | Delete
*
[1021] Fix | Delete
* If sorting is enabled directories and files will be sorted independently with
[1022] Fix | Delete
* directories appearing before files in the resultant array that is returned.
[1023] Fix | Delete
*
[1024] Fix | Delete
* Any parameter returned by stat is a valid sort parameter for this function.
[1025] Fix | Delete
* Filename comparisons are case insensitive.
[1026] Fix | Delete
*
[1027] Fix | Delete
* Examples:
[1028] Fix | Delete
*
[1029] Fix | Delete
* $sftp->setListOrder('filename', SORT_ASC);
[1030] Fix | Delete
* $sftp->setListOrder('size', SORT_DESC, 'filename', SORT_ASC);
[1031] Fix | Delete
* $sftp->setListOrder(true);
[1032] Fix | Delete
* Separates directories from files but doesn't do any sorting beyond that
[1033] Fix | Delete
* $sftp->setListOrder();
[1034] Fix | Delete
* Don't do any sort of sorting
[1035] Fix | Delete
*
[1036] Fix | Delete
* @access public
[1037] Fix | Delete
*/
[1038] Fix | Delete
public function setListOrder()
[1039] Fix | Delete
{
[1040] Fix | Delete
$this->sortOptions = array();
[1041] Fix | Delete
$args = func_get_args();
[1042] Fix | Delete
if (empty($args)) {
[1043] Fix | Delete
return;
[1044] Fix | Delete
}
[1045] Fix | Delete
$len = count($args) & 0x7FFFFFFE;
[1046] Fix | Delete
for ($i = 0; $i < $len; $i += 2) {
[1047] Fix | Delete
$this->sortOptions[$args[$i]] = $args[$i + 1];
[1048] Fix | Delete
}
[1049] Fix | Delete
if (!count($this->sortOptions)) {
[1050] Fix | Delete
$this->sortOptions = array('bogus' => true);
[1051] Fix | Delete
}
[1052] Fix | Delete
}
[1053] Fix | Delete
[1054] Fix | Delete
/**
[1055] Fix | Delete
* Returns the file size, in bytes, or false, on failure
[1056] Fix | Delete
*
[1057] Fix | Delete
* Files larger than 4GB will show up as being exactly 4GB.
[1058] Fix | Delete
*
[1059] Fix | Delete
* @param String $filename
[1060] Fix | Delete
*
[1061] Fix | Delete
* @return Mixed
[1062] Fix | Delete
* @access public
[1063] Fix | Delete
*/
[1064] Fix | Delete
public function size($filename)
[1065] Fix | Delete
{
[1066] Fix | Delete
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
[1067] Fix | Delete
return false;
[1068] Fix | Delete
}
[1069] Fix | Delete
[1070] Fix | Delete
$result = $this->stat($filename);
[1071] Fix | Delete
if ($result === false) {
[1072] Fix | Delete
return false;
[1073] Fix | Delete
}
[1074] Fix | Delete
[1075] Fix | Delete
return isset($result['size']) ? $result['size'] : -1;
[1076] Fix | Delete
}
[1077] Fix | Delete
[1078] Fix | Delete
/**
[1079] Fix | Delete
* Save files / directories to cache
[1080] Fix | Delete
*
[1081] Fix | Delete
* @param String $path
[1082] Fix | Delete
* @param Mixed $value
[1083] Fix | Delete
*
[1084] Fix | Delete
* @access private
[1085] Fix | Delete
*/
[1086] Fix | Delete
public function _update_stat_cache($path, $value)
[1087] Fix | Delete
{
[1088] Fix | Delete
// preg_replace('#^/|/(?=/)|/$#', '', $dir) == str_replace('//', '/', trim($path, '/'))
[1089] Fix | Delete
$dirs = explode('/', preg_replace('#^/|/(?=/)|/$#', '', $path));
[1090] Fix | Delete
[1091] Fix | Delete
$temp = &$this->stat_cache;
[1092] Fix | Delete
foreach ($dirs as $dir) {
[1093] Fix | Delete
if (!isset($temp[$dir])) {
[1094] Fix | Delete
$temp[$dir] = array();
[1095] Fix | Delete
}
[1096] Fix | Delete
if ($dir == end($dirs)) {
[1097] Fix | Delete
$temp[$dir] = $value;
[1098] Fix | Delete
}
[1099] Fix | Delete
$temp = &$temp[$dir];
[1100] Fix | Delete
}
[1101] Fix | Delete
}
[1102] Fix | Delete
[1103] Fix | Delete
/**
[1104] Fix | Delete
* Remove files / directories from cache
[1105] Fix | Delete
*
[1106] Fix | Delete
* @param String $path
[1107] Fix | Delete
*
[1108] Fix | Delete
* @return Boolean
[1109] Fix | Delete
* @access private
[1110] Fix | Delete
*/
[1111] Fix | Delete
public function _remove_from_stat_cache($path)
[1112] Fix | Delete
{
[1113] Fix | Delete
$dirs = explode('/', preg_replace('#^/|/(?=/)|/$#', '', $path));
[1114] Fix | Delete
[1115] Fix | Delete
$temp = &$this->stat_cache;
[1116] Fix | Delete
foreach ($dirs as $dir) {
[1117] Fix | Delete
if ($dir == end($dirs)) {
[1118] Fix | Delete
unset($temp[$dir]);
[1119] Fix | Delete
[1120] Fix | Delete
return true;
[1121] Fix | Delete
}
[1122] Fix | Delete
if (!isset($temp[$dir])) {
[1123] Fix | Delete
return false;
[1124] Fix | Delete
}
[1125] Fix | Delete
$temp = &$temp[$dir];
[1126] Fix | Delete
}
[1127] Fix | Delete
}
[1128] Fix | Delete
[1129] Fix | Delete
/**
[1130] Fix | Delete
* Checks cache for path
[1131] Fix | Delete
*
[1132] Fix | Delete
* Mainly used by file_exists
[1133] Fix | Delete
*
[1134] Fix | Delete
* @param String $dir
[1135] Fix | Delete
*
[1136] Fix | Delete
* @return Mixed
[1137] Fix | Delete
* @access private
[1138] Fix | Delete
*/
[1139] Fix | Delete
public function _query_stat_cache($path)
[1140] Fix | Delete
{
[1141] Fix | Delete
$dirs = explode('/', preg_replace('#^/|/(?=/)|/$#', '', $path));
[1142] Fix | Delete
[1143] Fix | Delete
$temp = &$this->stat_cache;
[1144] Fix | Delete
foreach ($dirs as $dir) {
[1145] Fix | Delete
if (!isset($temp[$dir])) {
[1146] Fix | Delete
return null;
[1147] Fix | Delete
}
[1148] Fix | Delete
$temp = &$temp[$dir];
[1149] Fix | Delete
}
[1150] Fix | Delete
[1151] Fix | Delete
return $temp;
[1152] Fix | Delete
}
[1153] Fix | Delete
[1154] Fix | Delete
/**
[1155] Fix | Delete
* Returns general information about a file.
[1156] Fix | Delete
*
[1157] Fix | Delete
* Returns an array on success and false otherwise.
[1158] Fix | Delete
*
[1159] Fix | Delete
* @param String $filename
[1160] Fix | Delete
*
[1161] Fix | Delete
* @return Mixed
[1162] Fix | Delete
* @access public
[1163] Fix | Delete
*/
[1164] Fix | Delete
public function stat($filename)
[1165] Fix | Delete
{
[1166] Fix | Delete
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
[1167] Fix | Delete
return false;
[1168] Fix | Delete
}
[1169] Fix | Delete
[1170] Fix | Delete
$filename = $this->_realpath($filename);
[1171] Fix | Delete
if ($filename === false) {
[1172] Fix | Delete
return false;
[1173] Fix | Delete
}
[1174] Fix | Delete
[1175] Fix | Delete
if ($this->use_stat_cache) {
[1176] Fix | Delete
$result = $this->_query_stat_cache($filename);
[1177] Fix | Delete
if (is_array($result) && isset($result['.'])) {
[1178] Fix | Delete
return (array) $result['.'];
[1179] Fix | Delete
}
[1180] Fix | Delete
if (is_object($result)) {
[1181] Fix | Delete
return (array) $result;
[1182] Fix | Delete
}
[1183] Fix | Delete
}
[1184] Fix | Delete
[1185] Fix | Delete
$stat = $this->_stat($filename, NET_SFTP_STAT);
[1186] Fix | Delete
if ($stat === false) {
[1187] Fix | Delete
$this->_remove_from_stat_cache($filename);
[1188] Fix | Delete
[1189] Fix | Delete
return false;
[1190] Fix | Delete
}
[1191] Fix | Delete
if (isset($stat['type'])) {
[1192] Fix | Delete
if ($stat['type'] == NET_SFTP_TYPE_DIRECTORY) {
[1193] Fix | Delete
$filename .= '/.';
[1194] Fix | Delete
}
[1195] Fix | Delete
$this->_update_stat_cache($filename, (object) $stat);
[1196] Fix | Delete
[1197] Fix | Delete
return $stat;
[1198] Fix | Delete
}
[1199] Fix | Delete
[1200] Fix | Delete
$pwd = $this->pwd;
[1201] Fix | Delete
$stat['type'] = $this->chdir($filename) ?
[1202] Fix | Delete
NET_SFTP_TYPE_DIRECTORY :
[1203] Fix | Delete
NET_SFTP_TYPE_REGULAR;
[1204] Fix | Delete
$this->pwd = $pwd;
[1205] Fix | Delete
[1206] Fix | Delete
if ($stat['type'] == NET_SFTP_TYPE_DIRECTORY) {
[1207] Fix | Delete
$filename .= '/.';
[1208] Fix | Delete
}
[1209] Fix | Delete
$this->_update_stat_cache($filename, (object) $stat);
[1210] Fix | Delete
[1211] Fix | Delete
return $stat;
[1212] Fix | Delete
}
[1213] Fix | Delete
[1214] Fix | Delete
/**
[1215] Fix | Delete
* Returns general information about a file or symbolic link.
[1216] Fix | Delete
*
[1217] Fix | Delete
* Returns an array on success and false otherwise.
[1218] Fix | Delete
*
[1219] Fix | Delete
* @param String $filename
[1220] Fix | Delete
*
[1221] Fix | Delete
* @return Mixed
[1222] Fix | Delete
* @access public
[1223] Fix | Delete
*/
[1224] Fix | Delete
public function lstat($filename)
[1225] Fix | Delete
{
[1226] Fix | Delete
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
[1227] Fix | Delete
return false;
[1228] Fix | Delete
}
[1229] Fix | Delete
[1230] Fix | Delete
$filename = $this->_realpath($filename);
[1231] Fix | Delete
if ($filename === false) {
[1232] Fix | Delete
return false;
[1233] Fix | Delete
}
[1234] Fix | Delete
[1235] Fix | Delete
if ($this->use_stat_cache) {
[1236] Fix | Delete
$result = $this->_query_stat_cache($filename);
[1237] Fix | Delete
if (is_array($result) && isset($result['.'])) {
[1238] Fix | Delete
return (array) $result['.'];
[1239] Fix | Delete
}
[1240] Fix | Delete
if (is_object($result)) {
[1241] Fix | Delete
return (array) $result;
[1242] Fix | Delete
}
[1243] Fix | Delete
}
[1244] Fix | Delete
[1245] Fix | Delete
$lstat = $this->_stat($filename, NET_SFTP_LSTAT);
[1246] Fix | Delete
if ($lstat === false) {
[1247] Fix | Delete
$this->_remove_from_stat_cache($filename);
[1248] Fix | Delete
[1249] Fix | Delete
return false;
[1250] Fix | Delete
}
[1251] Fix | Delete
if (isset($lstat['type'])) {
[1252] Fix | Delete
if ($lstat['type'] == NET_SFTP_TYPE_DIRECTORY) {
[1253] Fix | Delete
$filename .= '/.';
[1254] Fix | Delete
}
[1255] Fix | Delete
$this->_update_stat_cache($filename, (object) $lstat);
[1256] Fix | Delete
[1257] Fix | Delete
return $lstat;
[1258] Fix | Delete
}
[1259] Fix | Delete
[1260] Fix | Delete
$stat = $this->_stat($filename, NET_SFTP_STAT);
[1261] Fix | Delete
[1262] Fix | Delete
if ($lstat != $stat) {
[1263] Fix | Delete
$lstat = array_merge($lstat, array('type' => NET_SFTP_TYPE_SYMLINK));
[1264] Fix | Delete
$this->_update_stat_cache($filename, (object) $lstat);
[1265] Fix | Delete
[1266] Fix | Delete
return $stat;
[1267] Fix | Delete
}
[1268] Fix | Delete
[1269] Fix | Delete
$pwd = $this->pwd;
[1270] Fix | Delete
$lstat['type'] = $this->chdir($filename) ?
[1271] Fix | Delete
NET_SFTP_TYPE_DIRECTORY :
[1272] Fix | Delete
NET_SFTP_TYPE_REGULAR;
[1273] Fix | Delete
$this->pwd = $pwd;
[1274] Fix | Delete
[1275] Fix | Delete
if ($lstat['type'] == NET_SFTP_TYPE_DIRECTORY) {
[1276] Fix | Delete
$filename .= '/.';
[1277] Fix | Delete
}
[1278] Fix | Delete
$this->_update_stat_cache($filename, (object) $lstat);
[1279] Fix | Delete
[1280] Fix | Delete
return $lstat;
[1281] Fix | Delete
}
[1282] Fix | Delete
[1283] Fix | Delete
/**
[1284] Fix | Delete
* Returns general information about a file or symbolic link
[1285] Fix | Delete
*
[1286] Fix | Delete
* Determines information without calling Net_SFTP::_realpath().
[1287] Fix | Delete
* The second parameter can be either NET_SFTP_STAT or NET_SFTP_LSTAT.
[1288] Fix | Delete
*
[1289] Fix | Delete
* @param String $filename
[1290] Fix | Delete
* @param Integer $type
[1291] Fix | Delete
*
[1292] Fix | Delete
* @return Mixed
[1293] Fix | Delete
* @access private
[1294] Fix | Delete
*/
[1295] Fix | Delete
public function _stat($filename, $type)
[1296] Fix | Delete
{
[1297] Fix | Delete
// SFTPv4+ adds an additional 32-bit integer field - flags - to the following:
[1298] Fix | Delete
$packet = pack('Na*', strlen($filename), $filename);
[1299] Fix | Delete
if (!$this->_send_sftp_packet($type, $packet)) {
[1300] Fix | Delete
return false;
[1301] Fix | Delete
}
[1302] Fix | Delete
[1303] Fix | Delete
$response = $this->_get_sftp_packet();
[1304] Fix | Delete
switch ($this->packet_type) {
[1305] Fix | Delete
case NET_SFTP_ATTRS:
[1306] Fix | Delete
return $this->_parseAttributes($response);
[1307] Fix | Delete
case NET_SFTP_STATUS:
[1308] Fix | Delete
$this->_logError($response);
[1309] Fix | Delete
[1310] Fix | Delete
return false;
[1311] Fix | Delete
}
[1312] Fix | Delete
[1313] Fix | Delete
user_error('Expected SSH_FXP_ATTRS or SSH_FXP_STATUS');
[1314] Fix | Delete
[1315] Fix | Delete
return false;
[1316] Fix | Delete
}
[1317] Fix | Delete
[1318] Fix | Delete
/**
[1319] Fix | Delete
* Truncates a file to a given length
[1320] Fix | Delete
*
[1321] Fix | Delete
* @param String $filename
[1322] Fix | Delete
* @param Integer $new_size
[1323] Fix | Delete
*
[1324] Fix | Delete
* @return Boolean
[1325] Fix | Delete
* @access public
[1326] Fix | Delete
*/
[1327] Fix | Delete
public function truncate($filename, $new_size)
[1328] Fix | Delete
{
[1329] Fix | Delete
$attr = pack('N3', NET_SFTP_ATTR_SIZE, $new_size / 4294967296, $new_size); // 4294967296 == 0x100000000 == 1<<32
[1330] Fix | Delete
[1331] Fix | Delete
return $this->_setstat($filename, $attr, false);
[1332] Fix | Delete
}
[1333] Fix | Delete
[1334] Fix | Delete
/**
[1335] Fix | Delete
* Sets access and modification time of file.
[1336] Fix | Delete
*
[1337] Fix | Delete
* If the file does not exist, it will be created.
[1338] Fix | Delete
*
[1339] Fix | Delete
* @param String $filename
[1340] Fix | Delete
* @param optional Integer $time
[1341] Fix | Delete
* @param optional Integer $atime
[1342] Fix | Delete
*
[1343] Fix | Delete
* @return Boolean
[1344] Fix | Delete
* @access public
[1345] Fix | Delete
*/
[1346] Fix | Delete
public function touch($filename, $time = null, $atime = null)
[1347] Fix | Delete
{
[1348] Fix | Delete
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
[1349] Fix | Delete
return false;
[1350] Fix | Delete
}
[1351] Fix | Delete
[1352] Fix | Delete
$filename = $this->_realpath($filename);
[1353] Fix | Delete
if ($filename === false) {
[1354] Fix | Delete
return false;
[1355] Fix | Delete
}
[1356] Fix | Delete
[1357] Fix | Delete
if (!isset($time)) {
[1358] Fix | Delete
$time = time();
[1359] Fix | Delete
}
[1360] Fix | Delete
if (!isset($atime)) {
[1361] Fix | Delete
$atime = $time;
[1362] Fix | Delete
}
[1363] Fix | Delete
[1364] Fix | Delete
$flags = NET_SFTP_OPEN_WRITE | NET_SFTP_OPEN_CREATE | NET_SFTP_OPEN_EXCL;
[1365] Fix | Delete
$attr = pack('N3', NET_SFTP_ATTR_ACCESSTIME, $time, $atime);
[1366] Fix | Delete
$packet = pack('Na*Na*', strlen($filename), $filename, $flags, $attr);
[1367] Fix | Delete
if (!$this->_send_sftp_packet(NET_SFTP_OPEN, $packet)) {
[1368] Fix | Delete
return false;
[1369] Fix | Delete
}
[1370] Fix | Delete
[1371] Fix | Delete
$response = $this->_get_sftp_packet();
[1372] Fix | Delete
switch ($this->packet_type) {
[1373] Fix | Delete
case NET_SFTP_HANDLE:
[1374] Fix | Delete
return $this->_close_handle(substr($response, 4));
[1375] Fix | Delete
case NET_SFTP_STATUS:
[1376] Fix | Delete
$this->_logError($response);
[1377] Fix | Delete
break;
[1378] Fix | Delete
default:
[1379] Fix | Delete
user_error('Expected SSH_FXP_HANDLE or SSH_FXP_STATUS');
[1380] Fix | Delete
[1381] Fix | Delete
return false;
[1382] Fix | Delete
}
[1383] Fix | Delete
[1384] Fix | Delete
return $this->_setstat($filename, $attr, false);
[1385] Fix | Delete
}
[1386] Fix | Delete
[1387] Fix | Delete
/**
[1388] Fix | Delete
* Changes file or directory owner
[1389] Fix | Delete
*
[1390] Fix | Delete
* Returns true on success or false on error.
[1391] Fix | Delete
*
[1392] Fix | Delete
* @param String $filename
[1393] Fix | Delete
* @param Integer $uid
[1394] Fix | Delete
* @param optional Boolean $recursive
[1395] Fix | Delete
*
[1396] Fix | Delete
* @return Boolean
[1397] Fix | Delete
* @access public
[1398] Fix | Delete
*/
[1399] Fix | Delete
public function chown($filename, $uid, $recursive = false)
[1400] Fix | Delete
{
[1401] Fix | Delete
// quoting from <http://www.kernel.org/doc/man-pages/online/pages/man2/chown.2.html>,
[1402] Fix | Delete
// "if the owner or group is specified as -1, then that ID is not changed"
[1403] Fix | Delete
$attr = pack('N3', NET_SFTP_ATTR_UIDGID, $uid, -1);
[1404] Fix | Delete
[1405] Fix | Delete
return $this->_setstat($filename, $attr, $recursive);
[1406] Fix | Delete
}
[1407] Fix | Delete
[1408] Fix | Delete
/**
[1409] Fix | Delete
* Changes file or directory group
[1410] Fix | Delete
*
[1411] Fix | Delete
* Returns true on success or false on error.
[1412] Fix | Delete
*
[1413] Fix | Delete
* @param String $filename
[1414] Fix | Delete
* @param Integer $gid
[1415] Fix | Delete
* @param optional Boolean $recursive
[1416] Fix | Delete
*
[1417] Fix | Delete
* @return Boolean
[1418] Fix | Delete
* @access public
[1419] Fix | Delete
*/
[1420] Fix | Delete
public function chgrp($filename, $gid, $recursive = false)
[1421] Fix | Delete
{
[1422] Fix | Delete
$attr = pack('N3', NET_SFTP_ATTR_UIDGID, -1, $gid);
[1423] Fix | Delete
[1424] Fix | Delete
return $this->_setstat($filename, $attr, $recursive);
[1425] Fix | Delete
}
[1426] Fix | Delete
[1427] Fix | Delete
/**
[1428] Fix | Delete
* Set permissions on a file.
[1429] Fix | Delete
*
[1430] Fix | Delete
* Returns the new file permissions on success or false on error.
[1431] Fix | Delete
* If $recursive is true than this just returns true or false.
[1432] Fix | Delete
*
[1433] Fix | Delete
* @param Integer $mode
[1434] Fix | Delete
* @param String $filename
[1435] Fix | Delete
* @param optional Boolean $recursive
[1436] Fix | Delete
*
[1437] Fix | Delete
* @return Mixed
[1438] Fix | Delete
* @access public
[1439] Fix | Delete
*/
[1440] Fix | Delete
public function chmod($mode, $filename, $recursive = false)
[1441] Fix | Delete
{
[1442] Fix | Delete
if (is_string($mode) && is_int($filename)) {
[1443] Fix | Delete
$temp = $mode;
[1444] Fix | Delete
$mode = $filename;
[1445] Fix | Delete
$filename = $temp;
[1446] Fix | Delete
}
[1447] Fix | Delete
[1448] Fix | Delete
$attr = pack('N2', NET_SFTP_ATTR_PERMISSIONS, $mode & 07777);
[1449] Fix | Delete
if (!$this->_setstat($filename, $attr, $recursive)) {
[1450] Fix | Delete
return false;
[1451] Fix | Delete
}
[1452] Fix | Delete
if ($recursive) {
[1453] Fix | Delete
return true;
[1454] Fix | Delete
}
[1455] Fix | Delete
[1456] Fix | Delete
// rather than return what the permissions *should* be, we'll return what they actually are. this will also
[1457] Fix | Delete
// tell us if the file actually exists.
[1458] Fix | Delete
// incidentally, SFTPv4+ adds an additional 32-bit integer field - flags - to the following:
[1459] Fix | Delete
$packet = pack('Na*', strlen($filename), $filename);
[1460] Fix | Delete
if (!$this->_send_sftp_packet(NET_SFTP_STAT, $packet)) {
[1461] Fix | Delete
return false;
[1462] Fix | Delete
}
[1463] Fix | Delete
[1464] Fix | Delete
$response = $this->_get_sftp_packet();
[1465] Fix | Delete
switch ($this->packet_type) {
[1466] Fix | Delete
case NET_SFTP_ATTRS:
[1467] Fix | Delete
$attrs = $this->_parseAttributes($response);
[1468] Fix | Delete
[1469] Fix | Delete
return $attrs['permissions'];
[1470] Fix | Delete
case NET_SFTP_STATUS:
[1471] Fix | Delete
$this->_logError($response);
[1472] Fix | Delete
[1473] Fix | Delete
return false;
[1474] Fix | Delete
}
[1475] Fix | Delete
[1476] Fix | Delete
user_error('Expected SSH_FXP_ATTRS or SSH_FXP_STATUS');
[1477] Fix | Delete
[1478] Fix | Delete
return false;
[1479] Fix | Delete
}
[1480] Fix | Delete
[1481] Fix | Delete
/**
[1482] Fix | Delete
* Sets information about a file
[1483] Fix | Delete
*
[1484] Fix | Delete
* @param String $filename
[1485] Fix | Delete
* @param String $attr
[1486] Fix | Delete
* @param Boolean $recursive
[1487] Fix | Delete
*
[1488] Fix | Delete
* @return Boolean
[1489] Fix | Delete
* @access private
[1490] Fix | Delete
*/
[1491] Fix | Delete
public function _setstat($filename, $attr, $recursive)
[1492] Fix | Delete
{
[1493] Fix | Delete
if (!($this->bitmap & NET_SSH2_MASK_LOGIN)) {
[1494] Fix | Delete
return false;
[1495] Fix | Delete
}
[1496] Fix | Delete
[1497] Fix | Delete
$filename = $this->_realpath($filename);
[1498] Fix | Delete
if ($filename === false) {
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function