File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -175,6 +175,9 @@ function bb2html_aux($text, $export) {
175175 // [2] => a.b.c
176176 // )
177177
178+ $ email_addr_regex = "([A-Za-z0-9\.\-\_\@]*) " ;
179+ // should match all valid email addrs,
180+ // but not any hacker stuff like " alert(1)
178181 $ httpsregex = "(?: \"?)https\:\/\/([^\[ \"<\ ]+)(?: \"?) " ;
179182 // List of allowable tags
180183 $ bbtags = array (
@@ -198,8 +201,8 @@ function bb2html_aux($text, $export) {
198201 "@\[color=(?: \"?)(.{3,8})(?: \"?)\](.*?)\[/color\]@is " ,
199202 "@((?:<ol>|<ul>).*?) \n\*([^ \n]+) \n(.*?(</ol>|</ul>))@is " ,
200203 "@\[size=([1-9]|[0-2][0-9])\](.*?)\[/size\]@is " ,
201- "@\[mailto\](.*?) \[/mailto\]@is " ,
202- "@\[email\](.*?) \[/email\]@is " ,
204+ "@\[mailto\] $ email_addr_regex \[/mailto\]@is " ,
205+ "@\[email\] $ email_addr_regex \[/email\]@is " ,
203206 "@\[github\](?:\#|ticket:)(\d+)\[/github\]@is " ,
204207 "@\[github\]wiki:(.*?)\[/github\]@is " ,
205208 );
You can’t perform that action at this time.
0 commit comments