protected function filterBrowserVersions(array $userAgent)
    {
        // Safari and Opera 10.00+ version number is not encoded "normally"
        if (in_array($userAgent['browser_name'], ['safari', 'opera']) && stripos($userAgent['string'], ' version/')) {
            $userAgent['browser_version'] = preg_replace('|.+ version/([0-9]+(?:\.[0-9]+)?).*|i', '$1', $userAgent['string']);

            return $userAgent;
        }

        return $userAgent;
    }