How do I fix this error in my captcha php file

20 views Asked by At

I'm getting the following error message:

Fatal error: Cannot use isset() on the result of an expression (you can use "null !== expression" instead)

The code it refers to is this

$data['route'] = (isset($this->request->get['route']??$this->config->get('action_default'))) ? $this->request->get['route']??$this->config->get('action_default') : ''; 

in my google captcha file. What should it look like ?

Not tried anything as yet, it's been a while since I coded anything so thought I'd get some pointers before playing around with it.

1

There are 1 answers

1
Nigel Bones Turner On

I resolved the issue by changing the code to this

$data['route'] = ((null !== ($this->request->get['route'] ?? null)) ? ($this->request->get['route'] ?? $this->config->get('action_default')) : '');

Seems to have worked.