Skip to content

Commit

Permalink
! php8.0 can throw undefined error when using unset on an array key
Browse files Browse the repository at this point in the history
in an array that does exist but the key may not.  Plus the intention
of that line was to ensure only on option was set
! Nulling out the cookie name will cause set cookie to fail and lock
you out of the fourm
  • Loading branch information
Spuds committed Jan 16, 2023
1 parent b524ee7 commit 609496c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sources/admin/ManageServer.controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,15 @@ public function action_cookieSettings_display()
call_integration_hook('integrate_save_cookie_settings');

// Its either local or global cookies
if (!empty($this->_req->post->localCookies) && empty($this->_req->post->globalCookies))
if (!empty($this->_req->post->localCookies) && !empty($this->_req->post->globalCookies))
unset($this->_req->post->globalCookies);

if (!empty($this->_req->post->globalCookiesDomain) && strpos($boardurl, $this->_req->post->globalCookiesDomain) === false)
throw new Elk_Exception('invalid_cookie_domain', false);

if ($this->_req->getPost('cookiename', 'trim', '') === '')
$this->_req->post->cookiename = $cookiename;

$settingsForm->setConfigValues((array) $this->_req->post);
$settingsForm->save();

Expand Down

0 comments on commit 609496c

Please sign in to comment.