Revert "Merge tag 'v2.10.6'"

This reverts commit 122ea4ab9e, reversing
changes made to c54a11e250.
This commit is contained in:
2024-02-16 23:06:09 -06:00
parent 122ea4ab9e
commit 6c08ee9675
521 changed files with 12363 additions and 14503 deletions

View File

@@ -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;
}