MyBB Community Forums

Full Version: What's the default [img] mycode?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well, I deleted my image mycode for a plugin, so I was wondering what the default inputs were?
Like so I can have the direct image again...
 [img] direct image link [/img] 
Regex:
\[img\](.*?)\[/img\]
Replacement:
<img src="$1" alt="$1" />
From MyBB:
$message = preg_replace("#\[img\](\r\n?|\n?)(https?://([^<>\"']+?))\[/img\]#ise", "\$this->mycode_parse_img('$2')\n", $message);

Avoid using the (.*?) pattern - it can do things you don't expect it to.