WDZ Wrote:It supports, but bad support! in fact it is converted this way: <a href=""http://example.com"" >blabblab</a>CraKteR Wrote:But there is already an url mycodeApparently he wants support for [url="http://example.com"] but MyBB doesn't support the quotes...
and you know, it is a bad html, it can be worse if you hit by an attacker.
a good Regexp for your purpose is:
\[url=(["']?)([^"'[]+?)\\1\](.*?)\[\/url\]
<a href="$2">$3</a>
it will support:
[u rl="blab"]xx[/url]
[u rl='blab']xx[/url]
[u rl=blab]xx[/url]
but not support: {you may not do that by mybb standard.}
[url="bl"ab"]xx[/url]
[url="bl'ab"]xx[/url]
[url=blab"]xx[/url]
[url="blab]xx[/url]
[url="bl[ab"]xx[/url]
NOTE NOTE: it is not still completely safe against XSS:
[url="javascript:alert(1)"]xx[/url]
but there is a chance that this code if have not a trick agains fixjavascript() function of mybb, became safe...