Add g and i flags to regex keywords by default (or allow admins to set their own flags) #214

Closed
opened 2021-05-08 08:29:05 +00:00 by Denmark · 5 comments

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.

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.

Of course the other option would be to allow admins to add their own regex flags to the regex keywords.
Denmark changed title from Add g and i flags to regex keywords by default to Add g and i flags to regex keywords by default (or allow admins to set their own flags) 2021-05-08 08:43:45 +00:00

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.

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.

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

> 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`
Denmark reopened this issue 2021-05-10 01:29:08 +00:00

Try adding a forward slash at the beginning.

Try adding a forward slash at the beginning.

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.

> 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.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tslocum/tinyib#214
There is no content yet.