diff --git a/addons/plugins/BBCode/plugin.php b/addons/plugins/BBCode/plugin.php
index 0322966c..132b4689 100755
--- a/addons/plugins/BBCode/plugin.php
+++ b/addons/plugins/BBCode/plugin.php
@@ -103,13 +103,13 @@ public function handler_format_format($sender)
//$sender->content = preg_replace('/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]/', '', $sender->content);
// \[ (i|b|color|url|somethingelse) \=? ([^]]+)? \] (?: ([^]]*) \[\/\1\] )
+ // Links with display text: [url=http://url]text[/url]
+ $sender->content = preg_replace_callback("/\[url=(\w{2,6}:\/\/)?([^\]]*?)\](.*?)\[\/url\]/i", array($this, "linksCallback"), $sender->content);
+
// Images: [img]url[/img]
$replacement = $sender->inline ? "[image]" : "";
$sender->content = preg_replace("/\[img\](.*?)\[\/img\]/i", $replacement, $sender->content);
- // Links with display text: [url=http://url]text[/url]
- $sender->content = preg_replace_callback("/\[url=(\w{2,6}:\/\/)?([^\]]*?)\](.*?)\[\/url\]/i", array($this, "linksCallback"), $sender->content);
-
// Bold: [b]bold text[/b]
$sender->content = preg_replace("|\[b\](.*?)\[/b\]|si", "$1", $sender->content);