static $videoRegex = null;
static $quoteRegex = null;
static $quoteCallback = null;
+ static $attachmentRegex = null;
if ($videoRegex === null) {
$videoRegex = new Regex('\[video=[a-z]+\]');
return "[quote='".$username."','".$postLink."']";
});
+
+ $attachmentRegex = new Regex('\[attachment=([0-9]+)\]');
}
// attachment bbcodes
- $message = str_replace(array('[attachment=', '[/attachment]'), array('[attach=', '[/attach]'), $message);
+ $message = $attachmentRegex->replace($message, '[attach=\\1][/attach]');
// code bbcodes
$message = str_replace('[php]', '[code=php]', $message);