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

Do not rely to $GLOBALS['LANG'] #485

Open
froemken opened this issue Mar 7, 2024 · 0 comments
Open

Do not rely to $GLOBALS['LANG'] #485

froemken opened this issue Mar 7, 2024 · 0 comments

Comments

@froemken
Copy link

froemken commented Mar 7, 2024

Hello,

following line breaks as $GLOBALS['LANG'] is not defined:

return $GLOBALS['LANG'];

I have searched for a while to find out where and when $GLOBALS['LANG'] will be defined. It is only available in backend context and in some CLI commands, but for frontend usage I found following line in TYPO3 core:

https://github.com/TYPO3/typo3/blob/main/typo3/sysext/core/Classes/Localization/LanguageService.php#L29-L30

So, please check if $GLOBALS['LANG'] is available first and/or initialize it on your own.

Thank you for your work

Stefan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant