mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Added check tor stat results
When `$file` is a folder, the commands `filesize` and `filemtime` would result in the following warnings : PHP Warning: filemtime(): stat failed for /var/www/html/css in /var/www/html/ice/lib/file-control-xhr.php on line 921 PHP Warning: filesize(): stat failed for /var/www/html/css in /var/www/html/ice/lib/file-control-xhr.php on line 940 This patch corrects this.
This commit is contained in:
@@ -917,7 +917,7 @@ if (!isset($ftpSite) && !$error && $_GET['action']=="checkExists") {
|
||||
// ===================
|
||||
|
||||
// No $filemtime yet? Get it now!
|
||||
if (!isset($filemtime)) {
|
||||
if (!isset($filemtime) && !is_dir($file)) {
|
||||
$filemtime = $serverType=="Linux" ? filemtime($file) : "1000000";
|
||||
}
|
||||
// Set $timeStart, use 0 if not available
|
||||
@@ -937,7 +937,7 @@ if (isset($ftpSite)) {
|
||||
} else {
|
||||
$itemAbsPath = $file;
|
||||
$itemPath = dirname($file);
|
||||
$itemBytes = filesize($file);
|
||||
$itemBytes = is_dir($file) ? null : filesize($file);
|
||||
$itemType = (file_exists($file) ? (is_dir($file) ? "dir" : "file") : "unknown");
|
||||
$itemExists = (file_exists($file) ? "true" : "false");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user