Browse code

Make changes due to removed deprecated code ind Contao 5.x

Benjamin Roth authored on24/10/2023 16:21:37
Showing1 changed files
... ...
@@ -16,7 +16,16 @@
16 16
  * Miscellaneous
17 17
  */
18 18
 
19
-if (TL_MODE == 'FE')
19
+use Contao\CoreBundle\Routing\ScopeMatcher;
20
+use Contao\System;
21
+use Symfony\Component\HttpFoundation\Request;
22
+
23
+/** @var Request $request */
24
+$request = System::getContainer()->get('request_stack')->getCurrentRequest();
25
+/** @var ScopeMatcher $scopeMatcher */
26
+$scopeMatcher = System::getContainer()->get('contao.routing.scope_matcher');
27
+
28
+if ($scopeMatcher->isFrontendRequest($request))
20 29
 {
21 30
 	$GLOBALS['TL_LANG']['MSC']['confirmation'] = 'Passwort wiederholen';
22
-}
23 31
\ No newline at end of file
32
+}