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

v12: PHP Warning: Undefined array key "HTTP_REFERER" #56

Open
ulrike-cosmoblonde opened this issue Oct 17, 2023 · 0 comments
Open

v12: PHP Warning: Undefined array key "HTTP_REFERER" #56

ulrike-cosmoblonde opened this issue Oct 17, 2023 · 0 comments

Comments

@ulrike-cosmoblonde
Copy link

Hi,

I am using:
TYPO3 v12
PHP 8.1 with warnings active
Branch feature/v12

If I reload a form that has a cleverreach finisher configured and has been already submitted, I get a PHP warning: Undefined array key "HTTP_REFERER" in file /cleverreach/Classes/CleverReach/Api.php for line 292 in the function sendSubscribeMail.

If that line is adjusted as follows, the warning disappears:

 $doidata = [
            'user_ip' => $_SERVER['REMOTE_ADDR'],
            'user_agent' => $_SERVER['HTTP_USER_AGENT'],
            'referer' => key_exists('HTTP_REFERER',$_SERVER) ? $_SERVER['HTTP_REFERER'] : '',
        ];

Could you adjust the code?

Thanks!
Ulrike

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