Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate REQUEST_TOKEN #4727

Merged
merged 1 commit into from May 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 8 additions & 2 deletions DEPRECATED.md
Expand Up @@ -243,8 +243,8 @@ You can use the static helper methods such as `System::loadLanguageFile()` or

## Constants

The constants `TL_ROOT`, `TL_MODE`, `TL_START`, `TL_SCRIPT` and `TL_REFERER_ID`
have been deprecated and will be removed in Contao 5.0.
The constants `TL_ROOT`, `TL_MODE`, `TL_START`, `TL_SCRIPT`, `TL_REFERER_ID` and
`REQUEST_TOKEN` have been deprecated and will be removed in Contao 5.0.

Use the `kernel.project_dir` instead of `TL_ROOT`:

Expand Down Expand Up @@ -299,6 +299,12 @@ Use the the request attribute `_contao_referer_id` instead of `TL_REFERER_ID`:
$refererId = System::getContainer()->get('request_stack')->getCurrentRequest()->get('_contao_referer_id');
```

Use the `contao.csrf.token_manager` service instead of `REQUEST_TOKEN`:

```php
$requestToken = System::getContainer()->get('contao.csrf.token_manager')->getDefaultTokenValue();
```

## PHP entry points

Contao 4 only uses a single PHP entry point, namely the `index.php` or
Expand Down