🚀 Program
GSSoC
🐛 Describe the bug
In SpeechHistory.jsx, when users filter their speech history using the search bar, entering regex special characters (such as (, [, *, +, ?, \) without sanitization into a new RegExp(query, "i") constructor throws a fatal SyntaxError: Invalid regular expression crash, breaking the speech history rendering view.
🔁 Steps to Reproduce
Steps to reproduce the behavior:
- Go to the Speech History drawer or page.
- Type
( or [ in the search input box.
- See error with white screen or
SyntaxError: Invalid regular expression in DevTools console.
✅ Expected Behavior
Search queries should escape special regex characters or perform case-insensitive String.prototype.includes() matching to prevent regex syntax crashes.
❌ Actual Behavior
Typing special regex characters into the search bar throws a unhandled SyntaxError exception that crashes the history panel.
🌱 Contributor Checklist
💻 Environment
- Browser: Chrome, Firefox, Edge, Safari
- Device: Desktop, Laptop
- OS: Windows, macOS, Linux
📝 Additional Context
Replacing new RegExp() with sanitized string escaping or text.toLowerCase().includes(query.toLowerCase()) fixes the search crash.
🚀 Program
GSSoC
🐛 Describe the bug
In
SpeechHistory.jsx, when users filter their speech history using the search bar, entering regex special characters (such as(,[,*,+,?,\) without sanitization into anew RegExp(query, "i")constructor throws a fatalSyntaxError: Invalid regular expressioncrash, breaking the speech history rendering view.🔁 Steps to Reproduce
Steps to reproduce the behavior:
(or[in the search input box.SyntaxError: Invalid regular expressionin DevTools console.✅ Expected Behavior
Search queries should escape special regex characters or perform case-insensitive
String.prototype.includes()matching to prevent regex syntax crashes.❌ Actual Behavior
Typing special regex characters into the search bar throws a unhandled
SyntaxErrorexception that crashes the history panel.🌱 Contributor Checklist
💻 Environment
📝 Additional Context
Replacing
new RegExp()with sanitized string escaping ortext.toLowerCase().includes(query.toLowerCase())fixes the search crash.