You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone, I'm having an issue with my regular expression. How can I make it accept the use of hashtags without compromising security? I'm trying to implement this regular expression, but whenever I attempt, I receive an error.
My code
'patterns' => [
// Allow only hashtags
'#(?<![[:alnum:]])#\w+#',
// Add your other patterns for protection against XSS below:
// Evil starting attributes
'#(<[^>]+[\x00-\x20\"\'\/])(form|formaction|on\w*|style|xmlns|xlink:href)[^>]*>?#iUu',
// javascript:, livescript:, vbscript:, mocha: protocols
'!((java|live|vb)script|mocha|feed|data):(\w)*!iUu',
'#-moz-binding[\x00-\x20]*:#u',
// Unneeded tags
'#</*(applet|meta|xml|blink|link|style|script|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base|img)[^>]*>?#i'
],
any idea to solve this?
Error preg_match(): Unknown modifier ''
The text was updated successfully, but these errors were encountered:
Hello everyone, I'm having an issue with my regular expression. How can I make it accept the use of hashtags without compromising security? I'm trying to implement this regular expression, but whenever I attempt, I receive an error.
My code
'patterns' => [
// Allow only hashtags
'#(?<![[:alnum:]])#\w+#',
],
any idea to solve this?
Error preg_match(): Unknown modifier ''
The text was updated successfully, but these errors were encountered: