TeamMentor / Master

TEAM Mentor 3.x Released Code
16 stars 17 forks source link

TeamMentor Search feature: We need to implement TrimEnd function to avoid trailing characters #428

Open michaelhidalgo opened 11 years ago

michaelhidalgo commented 11 years ago

Considering that there exist an article titled "Assume All Input Is Malicious", then if you enter this text in the search box, we got results back:

god

BUT, if you enter the same text and you enter a white space at the end, the search fails (note that I'm using the same text pattern).

Bad

This issue could be addressed by using the TrimEnd to remove the trailing ocurrences of whitespaces.

DinisCruz commented 11 years ago

yes, we should trim the submitted text

note: The search is current a string search on both code and html (unless the title: prefix is used)

One area to improve the search would be to add something like http://lucenenet.apache.org/ to it

For reference the search code is at https://github.com/TeamMentor/Master/blob/3_3_Release/Web%20Applications/TeamMentor.CoreLib/TM_AppCode/XmlDatabase/TM_Xml_Database.Library.GuidanceItem.cs#L58 (which could do with a refactoring a clean up , since it still has the old RegEx code commented out)