Skip to content

Commit

Permalink
Merge pull request #380 from mashify/patch-2
Browse files Browse the repository at this point in the history
FIX: Hacky fix of #377
  • Loading branch information
tobyzerner committed Nov 9, 2014
2 parents 1ddf6a7 + e79f212 commit ccc62d8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions addons/plugins/BBCode/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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]" : "<img src='$1' alt='-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", "<b>$1</b>", $sender->content);

Expand Down

0 comments on commit ccc62d8

Please sign in to comment.