|
|
@@ -4,7 +4,7 @@ class Text {
|
|
4
|
4
|
* Array of valid tags; tag => max number of attributes
|
|
5
|
5
|
* @var array $ValidTags
|
|
6
|
6
|
*/
|
|
7
|
|
- private static $ValidTags = array('b'=>0, 'u'=>0, 'i'=>0, 's'=>0, '*'=>0, '#'=>0, 'ch'=>0, 'uch'=>0, 'artist'=>0, 'user'=>0, 'n'=>0, 'inlineurl'=>0, 'inlinesize'=>1, 'headline'=>1, 'align'=>1, 'color'=>1, 'colour'=>1, 'size'=>1, 'url'=>1, 'img'=>1, 'quote'=>1, 'pre'=>1, 'code'=>1, 'tex'=>0, 'hide'=>1, 'spoiler' => 1, 'plain'=>0, 'important'=>0, 'torrent'=>0, 'rule'=>0, 'mature'=>1, 'embed'=>0,
|
|
|
7
|
+ private static $ValidTags = array('b'=>0, 'u'=>0, 'i'=>0, 's'=>0, '*'=>0, '#'=>0, 'ch'=>0, 'uch'=>0, 'artist'=>0, 'user'=>0, 'n'=>0, 'inlineurl'=>0, 'inlinesize'=>1, 'headline'=>1, 'align'=>1, 'color'=>1, 'colour'=>1, 'size'=>1, 'url'=>1, 'img'=>1, 'quote'=>1, 'pre'=>1, 'code'=>1, 'tex'=>0, 'hide'=>1, 'spoiler' => 1, 'plain'=>0, 'important'=>0, 'torrent'=>0, 'rule'=>0, 'embed'=>0,
|
|
8
|
8
|
);
|
|
9
|
9
|
|
|
10
|
10
|
/**
|
|
|
@@ -563,9 +563,6 @@ class Text {
|
|
563
|
563
|
case 'hide':
|
|
564
|
564
|
$Array[$ArrayPos] = array('Type'=>'hide', 'Attr'=>$Attrib, 'Val'=>self::parse($Block));
|
|
565
|
565
|
break;
|
|
566
|
|
- case 'mature':
|
|
567
|
|
- $Array[$ArrayPos] = array('Type'=>'mature', 'Attr'=>$Attrib, 'Val'=>self::parse($Block));
|
|
568
|
|
- break;
|
|
569
|
566
|
case 'embed':
|
|
570
|
567
|
$Array[$ArrayPos] = array('Type'=>'embed', 'Val'=>$Block);
|
|
571
|
568
|
break;
|
|
|
@@ -820,7 +817,7 @@ class Text {
|
|
820
|
817
|
self::$NoImg++; // No images inside quote tags
|
|
821
|
818
|
self::$InQuotes++;
|
|
822
|
819
|
if (self::$InQuotes == self::$NestsBeforeHide) { //Put quotes that are nested beyond the specified limit in [hide] tags.
|
|
823
|
|
- $Str .= '<strong>Older quotes</strong>: <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
|
|
|
820
|
+ $Str .= '<strong>Older quotes</strong>: <a class="spoilerButton">Show</a>';
|
|
824
|
821
|
$Str .= '<blockquote class="hidden spoiler">';
|
|
825
|
822
|
}
|
|
826
|
823
|
if (!empty($Block['Attr'])) {
|
|
|
@@ -842,18 +839,9 @@ class Text {
|
|
842
|
839
|
self::$InQuotes--;
|
|
843
|
840
|
break;
|
|
844
|
841
|
case 'hide':
|
|
845
|
|
- $Str .= '<strong>'.(($Block['Attr']) ? $Block['Attr'] : 'Hidden text').'</strong>: <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
|
|
|
842
|
+ $Str .= '<strong>'.(($Block['Attr']) ? $Block['Attr'] : 'Hidden text').'</strong>: <a class="spoilerButton">Show</a>';
|
|
846
|
843
|
$Str .= '<blockquote class="hidden spoiler">'.self::to_html($Block['Val']).'</blockquote>';
|
|
847
|
844
|
break;
|
|
848
|
|
- case 'mature':
|
|
849
|
|
- if (!empty($Block['Attr'])) {
|
|
850
|
|
- $Str .= '<strong class="mature" style="font-size: 1.2em;">Mature content:</strong><strong> ' . $Block['Attr'] . '</strong><br /> <a href="javascript:void(0);" onclick="BBCode.spoiler(this);">Show</a>';
|
|
851
|
|
- $Str .= '<blockquote class="hidden spoiler">'.self::to_html($Block['Val']).'</blockquote>';
|
|
852
|
|
- }
|
|
853
|
|
- else {
|
|
854
|
|
- $Str .= '<strong>Use of the [mature] tag requires a description.</strong> The correct format is as follows: <strong>[mature=description] ...content... [/mature]</strong>, where "description" is a mandatory description of the post. Misleading descriptions will be penalized. For further information on our mature content policies, please refer to this <a href="wiki.php?action=article&id=1063">wiki</a>.';
|
|
855
|
|
- }
|
|
856
|
|
- break;
|
|
857
|
845
|
case 'img':
|
|
858
|
846
|
if (self::$NoImg > 0 && self::valid_url($Block['Val'])) {
|
|
859
|
847
|
$Str .= '<a rel="noreferrer" target="_blank" href="'.$Block['Val'].'">'.$Block['Val'].'</a> (image)';
|