Add g and i flags to regex keywords by default (or allow admins to set their own flags) #214
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: tslocum/tinyib#214
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
It's currently impossible to add regex flags to regex keywords yourself (because the input must end with a forward slash), so the software should have the g (global) and i (case-insensitive) regex flags enabled by default for regex keywords, to prevent easy keyword filter circumvention.
Of course the other option would be to allow admins to add their own regex flags to the regex keywords.
Add g and i flags to regex keywords by defaultto Add g and i flags to regex keywords by default (or allow admins to set their own flags)Regular expression keywords are not required to end in a forward slash. In fact, they are not validated at all. You should be able to add any desired flags.
No that's not true, if I enter:
test/i
as regular expression keyword and try to post something, there's an error:Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /var/www/html/inc/functions.php on line 317
Try adding a forward slash at the beginning.
Yes that seems to work. It's the "g" flag that the software has problems with, but ending the regex keyword with the i flag seems to work fine.