diff options
author | Phie <phie@phie.ovh> | 2019-04-09 19:55:47 +0300 |
---|---|---|
committer | Phie <phie@phie.ovh> | 2019-04-09 19:55:47 +0300 |
commit | c1680e3c8bd56ad20f736700e5740bb6ee7726a8 (patch) | |
tree | 7313ff3a557b879f211d1c9a18afdd65eff8bab3 /lib/Command | |
parent | 4f9f01dad50a59b88c49bb05eaf0ef928f2d092e (diff) |
lower case after removing accents
Diffstat (limited to 'lib/Command')
-rw-r--r-- | lib/Command/Search.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Command/Search.php b/lib/Command/Search.php index ea40754..787fd08 100644 --- a/lib/Command/Search.php +++ b/lib/Command/Search.php @@ -51,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { } $this->searchCache = $this->getCacheFolder()->newFile("carnet_search"); $this->searchCache->putContent("[]"); - $folder = $this->Config->getUserValue($userId , $this->appName, "note_folder"); + $folder = $this->Config->getUserValue($this->userId , $this->appName, "note_folder"); if(empty($folder)) $folder= 'Documents/QuickNote'; @@ -68,9 +68,10 @@ protected function execute(InputInterface $input, OutputInterface $output) { $path = substr($path, -1); $query = $input->getArgument('query'); - $query = strtolower($query); $query = $this->removeAccents($query); + $query = strtolower($query); + echo "searching ".$query; $this->search($path, $this->CarnetFolder->get($path), $query,0); $data = json_decode( $this->searchCache->getContent()); array_push($data, "end_of_search"); @@ -113,7 +114,7 @@ private function search($relativePath, $folder, $query, $curDepth){ } else{ - if(strstr($this->removeAccents(strtolower($in->getName())), $query)){ + if(strstr(strtolower($this->removeAccents($in->getName())), $query)){ $this->writeFound($relativePath, $in); continue; } @@ -137,7 +138,7 @@ private function search($relativePath, $folder, $query, $curDepth){ } catch(Exception $e){ } $index = $zipFile->getEntryContents("index.html"); - if(strstr($this->removeAccents(strtolower($index)), $query)){ + if(strstr(strtolower($this->removeAccents($index)), $query)){ $this->writeFound($relativePath,$in); } } catch(\OCP\Files\NotFoundException $e) { |