diff --git a/README.md b/README.md index 91db39f..98ad5c5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ The contao advanced form bundle adds a new form-field (Formpage) to forms that c --- -> Working with **Contao 4.9** and up to **Contao 4.12** (PHP ^7.4 and PHP 8) +> Working with **Contao 4.9** and up to **Contao 4.13** (PHP ^7.4 and PHP 8) --- diff --git a/src/Resources/contao/forms/FormPageSwitch.php b/src/Resources/contao/forms/FormPageSwitch.php index 1d992cc..c42a6a7 100644 --- a/src/Resources/contao/forms/FormPageSwitch.php +++ b/src/Resources/contao/forms/FormPageSwitch.php @@ -12,7 +12,6 @@ use Contao\FilesModel; use Contao\System; use Contao\Widget; -use Patchwork\Utf8; /** * Class FormSubmit @@ -60,10 +59,12 @@ public function validator($input) */ public function parse($arrAttributes=null) { - if (TL_MODE == 'BE') + $request = System::getContainer()->get('request_stack')->getCurrentRequest(); + + if ($request && System::getContainer()->get('contao.routing.scope_matcher')->isBackendRequest($request)) { $objTemplate = new BackendTemplate('be_wildcard'); - $objTemplate->wildcard = '### ' . Utf8::strtoupper($GLOBALS['TL_LANG']['FFL']['pageSwitch'][0]) . ' :: ' . $this->label . ' ###' . ($this->addCondition ? ' (' . $this->condition . ')' : ''); + $objTemplate->wildcard = '### ' . mb_strtoupper($GLOBALS['TL_LANG']['FFL']['pageSwitch'][0], 'UTF-8') . ' :: ' . $this->label . ' ###' . ($this->addCondition ? ' (' . $this->condition . ')' : ''); return $objTemplate->parse(); }