Merge pull request #3 from bobloy/also_search_tags

Search id and tags
This commit is contained in:
Eslyium 2020-09-14 16:38:06 -04:00 committed by GitHub
commit aedffa5677
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,8 +44,8 @@ foreach($json as $source => $sourceData){
foreach($cog['tags'] as $index => $this_tag){$cog['tags'][$index] = strtolower($this_tag);}
if($filter && !in_array(strtolower($filter), $cog['tags'])){ continue; }
if($search && strpos(strtolower($cog['id']), strtolower($search)) === false){
if(strpos(strtolower($cog['description'] ?: $cog['short']), strtolower($search)) === false){
continue;
if(strpos(strtolower($cog['description'] ?: $cog['short']), strtolower($search)) === false && !in_array(strtolower($search), $cog['tags'])){
continue;
}
}
array_push($cogs, $cog);