Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/undo-ransomware/ransomware_detection.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias <ilovemilk@wusa.io>2020-03-29 18:12:41 +0300
committerMatthias <ilovemilk@wusa.io>2020-03-29 18:12:41 +0300
commit892cf6bd9200e36aa89c2f3e4333d2601f5da268 (patch)
tree50e0ee35006a4c15c8cf83478a3b930a54a01313 /lib/Monitor.php
parentf1dcc36d1a7d6d6e4ac1f7cc57818c877357d32c (diff)
fix dependency injecting the monitor
Diffstat (limited to 'lib/Monitor.php')
-rw-r--r--lib/Monitor.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Monitor.php b/lib/Monitor.php
index 955d854..e77ba09 100644
--- a/lib/Monitor.php
+++ b/lib/Monitor.php
@@ -136,7 +136,8 @@ class Monitor
public function analyze($paths, $mode)
{
$path = $paths[0];
- $storage = $this->rootFolder->get(dirname($path))->getStorage();
+
+ $storage = $this->rootFolder->getUserFolder($this->userId)->get(dirname($path))->getStorage();
if ($this->userId === null || $this->nestingLevel !== 0 || !$this->isUploadedFile($storage, $path) || $this->isCreatingSkeletonFiles()) {
// check only cloud files and no system files
return;
@@ -353,7 +354,11 @@ class Monitor
$fullPath = $path;
if (property_exists($storage, 'mountPoint')) {
/* @var StorageWrapper $storage */
- $fullPath = $storage->mountPoint.$path;
+ try {
+ $fullPath = $storage->mountPoint.$path;
+ } catch (\Exception $ex) {
+ return false;
+ }
}
// ignore transfer files