mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-01-19 22:23:33 +01:00
Fixes search on plugins without Description
example "tables_ssl"
This commit is contained in:
parent
a3a40e1bcc
commit
da0fe98edc
1 changed files with 8 additions and 1 deletions
|
@ -84,7 +84,14 @@ exports.search = function(searchTerm, maxCacheAge, cb) {
|
||||||
for (var pluginName in results) { // for every available plugin
|
for (var pluginName in results) { // for every available plugin
|
||||||
if (pluginName.indexOf(plugins.prefix) != 0) continue; // TODO: Also search in keywords here!
|
if (pluginName.indexOf(plugins.prefix) != 0) continue; // TODO: Also search in keywords here!
|
||||||
|
|
||||||
if(searchTerm && !~pluginName.toLowerCase().indexOf(searchTerm) && !~results[pluginName].description.toLowerCase().indexOf(searchTerm)) continue;
|
if(searchTerm && !~results[pluginName].name.toLowerCase().indexOf(searchTerm)
|
||||||
|
&& (typeof results[pluginName].description != "undefined" && !~results[pluginName].description.toLowerCase().indexOf(searchTerm) )
|
||||||
|
){
|
||||||
|
if(typeof results[pluginName].description === "undefined"){
|
||||||
|
console.debug('plugin without Description: %s', results[pluginName].name);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
res[pluginName] = results[pluginName];
|
res[pluginName] = results[pluginName];
|
||||||
}
|
}
|
||||||
cb && cb(null, res)
|
cb && cb(null, res)
|
||||||
|
|
Loading…
Reference in a new issue