Changeset 31064

Show
Ignore:
Timestamp:
06.11.2016 19:06:32 (3 years ago)
Author:
litvinovg
Message:

Optimized regular expression in hierarchy menu

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/js/hierarchy.js

    r31063 r31064  
    238238        } 
    239239    } else { 
     240        var escapedInput = input.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); 
    240241        //RegExp to get SuggestionsMenu 
    241         var SuggestionsMenuExp = new RegExp(".*" + input + ".*","i") 
     242        var SuggestionsMenuExp = new RegExp( escapedInput,"i"); 
    242243         
    243244            for(var key in hierarchyData)