mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
Merge pull request #1904 from ether/fix/plugin-search
/admin/plugins: Fix search algorithm (use string match in lower case)
This commit is contained in:
commit
3e1e92c100
1 changed files with 2 additions and 2 deletions
|
@ -84,7 +84,7 @@ 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.indexOf(searchTerm) < 0 && results[pluginName].description.indexOf(searchTerm) < 0) continue;
|
if(searchTerm && !~pluginName.toLowerCase().indexOf(searchTerm) && !~results[pluginName].description.toLowerCase().indexOf(searchTerm)) continue;
|
||||||
res[pluginName] = results[pluginName];
|
res[pluginName] = results[pluginName];
|
||||||
}
|
}
|
||||||
cb && cb(null, res)
|
cb && cb(null, res)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue