|
@@ -66,20 +66,23 @@ function handleFile($filename, &$allDocuments) {
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
$found = false;
|
|
$found = false;
|
|
|
- foreach($allDocuments as $key => $document) {
|
|
|
|
|
- if($document['fileName'] == explode('/', $filename)[sizeof(explode('/', $filename)) - 1]) {
|
|
|
|
|
- $labelPath = Label::getLabelByID($document['labelID'])->getPath();
|
|
|
|
|
|
|
|
|
|
|
|
+ if($allDocuments) {
|
|
|
|
|
+ foreach($allDocuments as $key => $document) {
|
|
|
|
|
+ if($document['fileName'] == explode('/', $filename)[sizeof(explode('/', $filename)) - 1]) {
|
|
|
|
|
+ $labelPath = Label::getLabelByID($document['labelID'])->getPath();
|
|
|
|
|
|
|
|
- if(str_replace($CONFIG['documentPath'], "", $filename) == $labelPath . "/" . $document['path'] . $document['fileName']) {
|
|
|
|
|
- // found
|
|
|
|
|
- // update stuff
|
|
|
|
|
- unset($allDocuments[$key]); // remove from array
|
|
|
|
|
- $found = true;
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
- // same filename, path unknown
|
|
|
|
|
|
|
+ if(str_replace($CONFIG['documentPath'], "", $filename) == $labelPath . "/" . $document['path'] . $document['fileName']) {
|
|
|
|
|
+ // found
|
|
|
|
|
+ // update stuff
|
|
|
|
|
+ unset($allDocuments[$key]); // remove from array
|
|
|
|
|
+ $found = true;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // same filename, path unknown
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|