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

github.com/CarnetApp/CarnetNextcloud.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Misc/Search.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/Misc/Search.php b/lib/Misc/Search.php
index 74de4e3..cdcf303 100644
--- a/lib/Misc/Search.php
+++ b/lib/Misc/Search.php
@@ -132,11 +132,14 @@ private function search($relativePath, $folder, $query, $curDepth){
try {
$metadata = json_decode($zipFile->getEntryContents("metadata.json"));
$hasFound = false;
- foreach($metadata->keywords as $keyword){
- if(strstr($this->removeAccents(strtolower($keyword)), $query)){
- $this->writeFound($relativePath,$in);
- $hasFound = true;
- break;
+ if (is_object ($metadata))
+ {
+ foreach($metadata->keywords as $keyword){
+ if(strstr($this->removeAccents(strtolower($keyword)), $query)){
+ $this->writeFound($relativePath,$in);
+ $hasFound = true;
+ break;
+ }
}
}
if($hasFound){