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.php18
-rwxr-xr-xtemplates/settings.php2
2 files changed, 12 insertions, 8 deletions
diff --git a/lib/Misc/Search.php b/lib/Misc/Search.php
index 018f112..3ee11a0 100644
--- a/lib/Misc/Search.php
+++ b/lib/Misc/Search.php
@@ -17,6 +17,7 @@ class Search {
private $searchCache;
private $current=0;
private $from;
+ private $pathArray = array ();
/**
* @param string $appName
@@ -131,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){
@@ -145,7 +149,7 @@ private function search($relativePath, $folder, $query, $curDepth){
} catch(Exception $e){
}
$index = $zipFile->getEntryContents("index.html");
- if(strstr(strtolower($this->removeAccents($index)), $query)){
+ if(trim ($query) !== "" && strstr(strtolower($this->removeAccents($index)), $query)){
$this->writeFound($relativePath,$in);
}
} catch(\OCP\Files\NotFoundException $e) {
@@ -188,4 +192,4 @@ $this->setName('carnet:search')
}
-?> \ No newline at end of file
+?>
diff --git a/templates/settings.php b/templates/settings.php
index 3573f52..1d4396e 100755
--- a/templates/settings.php
+++ b/templates/settings.php
@@ -25,7 +25,7 @@ if($_['carnet_display_fullscreen']==="yes"){
if($_['nc_version']>=16)
style("carnet","../templates/CarnetElectron/compatibility/nextcloud/nc16");
}
-else if($_['nc_version']>=14)
+else if(isset ($_['nc_version']) && $_['nc_version']>=14)
style("carnet","../templates/CarnetElectron/compatibility/nextcloud/nc14-header");
$nonce = "";
if (method_exists(\OC::$server, "getContentSecurityPolicyNonceManager")){