Skip to content

Commit

Permalink
Merge pull request smrealms#387 from hemberger/nbbc-composer
Browse files Browse the repository at this point in the history
Install NBBC with Composer
  • Loading branch information
hemberger authored Apr 2, 2018
2 parents 55ebc63 + 4605e69 commit 47fddf3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2,055 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"facebook/graph-sdk": "^5.5.0",
"google/recaptcha": "~1.1",
"php": "5.4.0 - 7.2",
"phpmailer/phpmailer": "~6.0"
"phpmailer/phpmailer": "~6.0",
"vanilla/nbbc": "~2.0"
}
}
10 changes: 5 additions & 5 deletions lib/Default/smr.inc
Original file line number Diff line number Diff line change
Expand Up @@ -149,20 +149,20 @@ function xmlify($str) {
function bbifyMessage($message, $noLinks=false) {
static $bbParser;
if(!isset($bbParser)) {
require_once(LIB.'External/BBCode/nbbc.php');
$bbParser = new BBCode();
$bbParser = new \Nbbc\BBCode();
$bbParser->SetEnableSmileys(false);
$bbParser->RemoveRule('wiki');
$bbParser->RemoveRule('img');
$bbParser->SetURLTarget('_blank');
$bbParser->SetURLTargetable('override');
$bbParser->setEscapeContent(false); // don't escape HTML, needed for News etc.
$smrRule = array(
'mode' => BBCODE_MODE_CALLBACK,
'mode' => \Nbbc\BBCode::BBCODE_MODE_CALLBACK,
'method' => 'smrBBCode',
'class' => 'link',
'allow_in' => Array('listitem', 'block', 'columns', 'inline'),
'end_tag' => BBCODE_PROHIBIT,
'content' => BBCODE_PROHIBIT,
'end_tag' => \Nbbc\BBCode::BBCODE_PROHIBIT,
'content' => \Nbbc\BBCode::BBCODE_PROHIBIT,
);
$bbParser->AddRule('combatlog',$smrRule);
$bbParser->AddRule('player',$smrRule);
Expand Down
Loading

0 comments on commit 47fddf3

Please sign in to comment.