MyBB Community Forums
[Security] Regex in custom profile field causes error - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [Security] Regex in custom profile field causes error (/thread-225366.html)



Regex in custom profile field causes error - Monkeys - 2019-11-19

I've created a custom profile field called "Discord username" with the following Regular Expression: ^[^#]{2,32}#\d{4}$ (https://i.imgur.com/yy0VpKE.png)



Forum URL: https://lifepunch.net/forums



When users try to create a new account, even if they enter a value that respects the Regex (such as hello#1234) it will error.



If a user tries to edit their profile and add any value under Discord username, the following error appears at the top of the page; https://i.imgur.com/3NIPp6Q.png



This is a new installation of 1.8.21



For now, I've removed the REGEX from that custom profile field and things are working fine.



RE: Regex in custom profile field causes error - Devilshakerz - 2019-11-19

MyBB uses # as the regex delimiter internally, so escape it with a backslash:
^[^\#]{2,32}\#\d{4}$



RE: Regex in custom profile field causes error - Monkeys - 2019-11-19

Excellent, thank you! Smile