// /core/core-bbcode.php
// ...
$this->result = preg_replace_callback('~\[URL(?:=([^\]]*))?\](.*?)\[/URL\]~i',
create_function('$a','return \'<a href="\'.htmlentities(
preg_replace(\'~[\[\]]~\',\'\',$a[1] != \'\'?$a[1]:$a[2]),ENT_QUOTES).\'" target="_blank">\'.$a[2].\'</a>\';'),$this->result);
// ...