From f922456a8fb262d0231f69da1e06333f89907240 Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 29 Mar 2022 13:59:25 -0700 Subject: [PATCH] Fixes #4706 'quote' bbcode in TinyMce and fixes fatal error under PHP 8.1 (LAN_WROTE) --- e107_core/bbcodes/quote.bb | 7 ++----- e107_plugins/tinymce4/plugins/e107/parser.php | 5 +++++ e107_tests/tests/unit/e_bbcodeTest.php | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/e107_core/bbcodes/quote.bb b/e107_core/bbcodes/quote.bb index 4a7270705..e74f8fb76 100644 --- a/e107_core/bbcodes/quote.bb +++ b/e107_core/bbcodes/quote.bb @@ -1,13 +1,10 @@ //getClass('quote'); -e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/lan_parser_functions.php"); +e107::includeLan(e_LANGUAGEDIR.e_LANGUAGE."/".e_LANGUAGE.".php"); if(deftrue('BOOTSTRAP')) { - return '
-

'.$code_text.'

- '.$parm.' -
'; + return '

'.$code_text.'

'.$parm.'
'; } return "
$parm ".LAN_WROTE." ...
$code_text
"; diff --git a/e107_plugins/tinymce4/plugins/e107/parser.php b/e107_plugins/tinymce4/plugins/e107/parser.php index 9e10aabc7..a017cccf1 100644 --- a/e107_plugins/tinymce4/plugins/e107/parser.php +++ b/e107_plugins/tinymce4/plugins/e107/parser.php @@ -117,6 +117,11 @@ TEMPL; $fa = e107::getTheme()->getFontAwesome(); // get the frontend theme's fontawesome version. $tp->setFontAwesome($fa); + if(!defined('BOOTSTRAP') && ($bs = e107::getTheme()->getLibVersion('bootstrap'))) + { + define('BOOTSTRAP', (int) $bs); + } + $content = stripslashes($content); // $content = e107::getBB()->htmltoBBcode($content); //XXX This breaks inserted images from media-manager. :/ diff --git a/e107_tests/tests/unit/e_bbcodeTest.php b/e107_tests/tests/unit/e_bbcodeTest.php index e821e0c8c..bc2d116f9 100644 --- a/e107_tests/tests/unit/e_bbcodeTest.php +++ b/e107_tests/tests/unit/e_bbcodeTest.php @@ -215,6 +215,8 @@ ), 'quote' => array ( + 'Ted' => array('input'=>'Quoted Message', 'expected'=>'

Quoted Message

Ted
'), + ), 'right' => array (