mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-05 10:11:25 -05:00
Apply fixes from StyleCI
[ci skip] [skip ci]
This commit is contained in:
+17
-17
@@ -22,37 +22,37 @@ class Bbcode
|
||||
'h1' => [
|
||||
'pattern' => '/\[h1\](.*?)\[\/h1\]/s',
|
||||
'replace' => '<h1>$1</h1>',
|
||||
'content' => '$1'
|
||||
'content' => '$1',
|
||||
],
|
||||
|
||||
'h2' => [
|
||||
'pattern' => '/\[h2\](.*?)\[\/h2\]/s',
|
||||
'replace' => '<h2>$1</h2>',
|
||||
'content' => '$1'
|
||||
'content' => '$1',
|
||||
],
|
||||
|
||||
'h3' => [
|
||||
'pattern' => '/\[h3\](.*?)\[\/h3\]/s',
|
||||
'replace' => '<h3>$1</h3>',
|
||||
'content' => '$1'
|
||||
'content' => '$1',
|
||||
],
|
||||
|
||||
'h4' => [
|
||||
'pattern' => '/\[h4\](.*?)\[\/h4\]/s',
|
||||
'replace' => '<h4>$1</h4>',
|
||||
'content' => '$1'
|
||||
'content' => '$1',
|
||||
],
|
||||
|
||||
'h5' => [
|
||||
'pattern' => '/\[h5\](.*?)\[\/h5\]/s',
|
||||
'replace' => '<h5>$1</h5>',
|
||||
'content' => '$1'
|
||||
'content' => '$1',
|
||||
],
|
||||
|
||||
'h6' => [
|
||||
'pattern' => '/\[h6\](.*?)\[\/h6\]/s',
|
||||
'replace' => '<h6>$1</h6>',
|
||||
'content' => '$1'
|
||||
'content' => '$1',
|
||||
],
|
||||
|
||||
'bold' => [
|
||||
@@ -215,19 +215,19 @@ class Bbcode
|
||||
'sub' => [
|
||||
'pattern' => '/\[sub\](.*?)\[\/sub\]/s',
|
||||
'replace' => '<sub>$1</sub>',
|
||||
'content' => '$1'
|
||||
'content' => '$1',
|
||||
],
|
||||
|
||||
'sup' => [
|
||||
'pattern' => '/\[sup\](.*?)\[\/sup\]/s',
|
||||
'replace' => '<sup>$1</sup>',
|
||||
'content' => '$1'
|
||||
'content' => '$1',
|
||||
],
|
||||
|
||||
'small' => [
|
||||
'pattern' => '/\[small\](.*?)\[\/small\]/s',
|
||||
'replace' => '<small>$1</small>',
|
||||
'content' => '$1'
|
||||
'content' => '$1',
|
||||
],
|
||||
|
||||
'table' => [
|
||||
@@ -309,7 +309,7 @@ class Bbcode
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses the BBCode string
|
||||
* Parses the BBCode string.
|
||||
*
|
||||
* @param $source
|
||||
* @param bool $caseInsensitive
|
||||
@@ -318,7 +318,7 @@ class Bbcode
|
||||
public function parse($source, $caseInsensitive = false)
|
||||
{
|
||||
foreach ($this->enabledParsers as $name => $parser) {
|
||||
$pattern = ($caseInsensitive) ? $parser['pattern'] . 'i' : $parser['pattern'];
|
||||
$pattern = ($caseInsensitive) ? $parser['pattern'].'i' : $parser['pattern'];
|
||||
|
||||
$source = $this->searchAndReplace($pattern, $parser['replace'], $source);
|
||||
}
|
||||
@@ -327,7 +327,7 @@ class Bbcode
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove all BBCode
|
||||
* Remove all BBCode.
|
||||
*
|
||||
* @param string $source
|
||||
* @return string Parsed text
|
||||
@@ -335,14 +335,14 @@ class Bbcode
|
||||
public function stripBBCodeTags($source)
|
||||
{
|
||||
foreach ($this->parsers as $name => $parser) {
|
||||
$source = $this->searchAndReplace($parser['pattern'] . 'i', $parser['content'], $source);
|
||||
$source = $this->searchAndReplace($parser['pattern'].'i', $parser['content'], $source);
|
||||
}
|
||||
|
||||
return $source;
|
||||
}
|
||||
|
||||
/**
|
||||
* Searches after a specified pattern and replaces it with provided structure
|
||||
* Searches after a specified pattern and replaces it with provided structure.
|
||||
*
|
||||
* @param string $pattern Search pattern
|
||||
* @param string $replace Replacement structure
|
||||
@@ -359,7 +359,7 @@ class Bbcode
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to parse case sensitive
|
||||
* Helper function to parse case sensitive.
|
||||
*
|
||||
* @param string $source String containing the BBCode
|
||||
* @return string Parsed text
|
||||
@@ -370,7 +370,7 @@ class Bbcode
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to parse case insensitive
|
||||
* Helper function to parse case insensitive.
|
||||
*
|
||||
* @param string $source String containing the BBCode
|
||||
* @return string Parsed text
|
||||
@@ -381,7 +381,7 @@ class Bbcode
|
||||
}
|
||||
|
||||
/**
|
||||
* List of chosen parsers
|
||||
* List of chosen parsers.
|
||||
*
|
||||
* @return array array of parsers
|
||||
*/
|
||||
|
||||
@@ -107,6 +107,7 @@ class Article extends Model
|
||||
public function getContentHtml()
|
||||
{
|
||||
$bbcode = new Bbcode();
|
||||
|
||||
return $bbcode->parse($this->content, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -97,6 +97,7 @@ class Comment extends Model
|
||||
public function getContentHtml()
|
||||
{
|
||||
$bbcode = new Bbcode();
|
||||
|
||||
return $bbcode->parse($this->content, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,7 @@ class Message extends Model
|
||||
public static function getMessageHtml($message)
|
||||
{
|
||||
$bbcode = new Bbcode();
|
||||
|
||||
return $bbcode->parse($message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ class Page extends Model
|
||||
public function getContentHtml()
|
||||
{
|
||||
$bbcode = new Bbcode();
|
||||
|
||||
return $bbcode->parse($this->content, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ class Post extends Model
|
||||
public function getContentHtml()
|
||||
{
|
||||
$bbcode = new Bbcode();
|
||||
|
||||
return $bbcode->parse($this->content, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,7 @@ class PrivateMessage extends Model
|
||||
public function getMessageHtml()
|
||||
{
|
||||
$bbcode = new Bbcode();
|
||||
|
||||
return $bbcode->parse($this->message, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,8 +303,8 @@ class Torrent extends Model
|
||||
public function getDescriptionHtml()
|
||||
{
|
||||
$bbcode = new Bbcode();
|
||||
return $bbcode->parse($this->description, true);
|
||||
|
||||
return $bbcode->parse($this->description, true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -192,6 +192,7 @@ class TorrentRequest extends Model
|
||||
public function getDescriptionHtml()
|
||||
{
|
||||
$bbcode = new Bbcode();
|
||||
|
||||
return $bbcode->parse($this->description, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -939,6 +939,7 @@ class User extends Authenticatable
|
||||
public function getSignature()
|
||||
{
|
||||
$bbcode = new Bbcode();
|
||||
|
||||
return $bbcode->parse($this->signature, true);
|
||||
}
|
||||
|
||||
@@ -953,6 +954,7 @@ class User extends Authenticatable
|
||||
return 'N/A';
|
||||
} else {
|
||||
$bbcode = new Bbcode();
|
||||
|
||||
return $bbcode->parse($this->about, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user