mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-18 13:05:42 +00:00
Remove hidden characters from form fields (#3597)
* Remove control and non-printable characters from form fields (server side) * Update regex to properly filter out control characters only * Add regex lib to requirements flie * Fix regex in javascript (client side) * add required unicode flag
This commit is contained in:
@ -341,8 +341,8 @@ function sanitizeInputString(s, options={}) {
|
||||
// Remove ASCII control characters
|
||||
s = s.replace(/[\x01-\x1F]+/g, '');
|
||||
|
||||
// Remove non-printable characters
|
||||
s = s.replace(/[^ -~]+/g, '');
|
||||
// Remove Unicode control characters
|
||||
s = s.replace(/[\p{C}]+/gu, '');
|
||||
|
||||
s = s.trim();
|
||||
|
||||
|
Reference in New Issue
Block a user