Skip to content

Commit

Permalink
Fix for Opera Browser
Browse files Browse the repository at this point in the history
We had user reported problems with the Opera browser accessing the forum after we upgraded to php 8.2. This change looks like what was actually intended by the code, and it did solve the problem.
  • Loading branch information
nwsw authored Dec 19, 2024
1 parent 36764dd commit e1bc86d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sources/BrowserDetector.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,13 @@ private function _setMajorVersion()
}
elseif ($this->_browsers['is_opera'])
{
if (preg_match('~OPR[/]([0-9][0-9]?[.])~i', $this->_ua, $match) === 1)
if (preg_match('~OPR[/]([0-9][0-9]?[.])~i', $this->_ua, $match) === 1) {
$this->_browsers['is_opera' . (int) trim($match[1])] = true;

// Since opera >= 15 wants to look like chrome, set the body to do just that
if (trim($match[1]) >= 15)
$this->_browsers['is_chrome'] = true;
// Since opera >= 15 wants to look like chrome, set the body to do just that
if (trim($match[1]) >= 15)
$this->_browsers['is_chrome'] = true;
}
}
}

Expand Down

0 comments on commit e1bc86d

Please sign in to comment.