|
|
@@ -41,7 +41,7 @@ function scanDocuments($path) {
|
|
|
|
|
|
handleFile($files, $allDocuments);
|
|
|
|
|
|
- if(sizeof($allDocuments) > 0) { // Documents got removed
|
|
|
+ if(sizeof($allDocuments) > 0 && $allDocuments) { // Documents got removed
|
|
|
foreach($allDocuments as $document) {
|
|
|
Document::removeDocumentByID($document['id']);
|
|
|
}
|
|
|
@@ -106,6 +106,9 @@ function searchMails() {
|
|
|
global $user;
|
|
|
$mailboxes = Mailbox::getAllMailBoxes();
|
|
|
$lastMailOption = Option::getOptionByKey("lastMailSearch");
|
|
|
+ if($lastMailOption == false) {
|
|
|
+ $lastMailOption = 0;
|
|
|
+ }
|
|
|
$date = date("d-M-Y", $lastMailOption->getValue());
|
|
|
|
|
|
|