Revert "Merge tag 'v2.10.6'"
This reverts commit122ea4ab9e
, reversing changes made toc54a11e250
.
This commit is contained in:
@@ -7,12 +7,6 @@ namespace Shimmie2;
|
||||
class BBCode extends FormatterExtension
|
||||
{
|
||||
public function format(string $text): string
|
||||
{
|
||||
$text = $this->_format($text);
|
||||
return "<span class='bbcode'>$text</span>";
|
||||
}
|
||||
|
||||
public function _format(string $text): string
|
||||
{
|
||||
$text = $this->extract_code($text);
|
||||
foreach ([
|
||||
@@ -103,8 +97,8 @@ class BBCode extends FormatterExtension
|
||||
}
|
||||
|
||||
$beginning = substr($text, 0, $start);
|
||||
$middle = str_rot13(substr($text, $start + $l1, ($end - $start - $l1)));
|
||||
$ending = substr($text, $end + $l2, (strlen($text) - $end + $l2));
|
||||
$middle = str_rot13(substr($text, $start+$l1, ($end-$start-$l1)));
|
||||
$ending = substr($text, $end + $l2, (strlen($text)-$end+$l2));
|
||||
|
||||
$text = $beginning . $middle . $ending;
|
||||
}
|
||||
@@ -137,8 +131,8 @@ class BBCode extends FormatterExtension
|
||||
}
|
||||
|
||||
$beginning = substr($text, 0, $start);
|
||||
$middle = base64_encode(substr($text, $start + $l1, ($end - $start - $l1)));
|
||||
$ending = substr($text, $end + $l2, (strlen($text) - $end + $l2));
|
||||
$middle = base64_encode(substr($text, $start+$l1, ($end-$start-$l1)));
|
||||
$ending = substr($text, $end + $l2, (strlen($text)-$end+$l2));
|
||||
|
||||
$text = $beginning . "[code!]" . $middle . "[/code!]" . $ending;
|
||||
}
|
||||
@@ -161,10 +155,10 @@ class BBCode extends FormatterExtension
|
||||
}
|
||||
|
||||
$beginning = substr($text, 0, $start);
|
||||
$middle = base64_decode(substr($text, $start + $l1, ($end - $start - $l1)));
|
||||
$ending = substr($text, $end + $l2, (strlen($text) - $end + $l2));
|
||||
$middle = base64_decode(substr($text, $start+$l1, ($end-$start-$l1)));
|
||||
$ending = substr($text, $end + $l2, (strlen($text)-$end+$l2));
|
||||
|
||||
$text = $beginning . "<pre class='code'>" . $middle . "</pre>" . $ending;
|
||||
$text = $beginning . "<pre>" . $middle . "</pre>" . $ending;
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
Reference in New Issue
Block a user