diff options
author | Stefan Giehl <stefan@matomo.org> | 2020-11-27 21:44:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-27 21:44:16 +0300 |
commit | 3cb1d5406a0d9fc30d7baa9473f16eb71a10052f (patch) | |
tree | 1791f6a5954bb157b5d3944c9fbd3817f1be47cc /core | |
parent | 8ba7a162846d0cfab5638d3459c9f3938b8e7856 (diff) |
Ignore errors while updating session ids (#16829)
Diffstat (limited to 'core')
-rw-r--r-- | core/Updates/4.0.0-b1.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/Updates/4.0.0-b1.php b/core/Updates/4.0.0-b1.php index 18531968b2..79932200ab 100644 --- a/core/Updates/4.0.0-b1.php +++ b/core/Updates/4.0.0-b1.php @@ -240,7 +240,11 @@ class Updates_4_0_0_b1 extends PiwikUpdates foreach ($sessions as $session) { if (!empty($session['id']) && Common::mb_strlen($session['id']) != 128) { $bind = [ hash('sha512', $session['id'] . $salt), $session['id'] ]; - Db::query(sprintf('UPDATE %s SET id = ? WHERE id = ?', Common::prefixTable('session')), $bind); + try { + Db::query(sprintf('UPDATE %s SET id = ? WHERE id = ?', Common::prefixTable('session')), $bind); + } catch (\Exception $e) { + // ignore possible duplicate key errors + } } } |