diff --git a/_common/KeymanSentry.php b/_common/KeymanSentry.php index eee6fca..197fcea 100644 --- a/_common/KeymanSentry.php +++ b/_common/KeymanSentry.php @@ -26,9 +26,18 @@ static function GetBrowserHtml($dsn, $release = null) { $release = `release: '$release',`; } + // Parse out the DSN short string from DSN like: + // 'https://44d5544d7c45466ba1928b9196faf67e@o1005580.ingest.sentry.io/5983516' + // (this one was for keyman.com) + if(!preg_match('/\/\/(.+)@/', $dsn, $matches)) { + // invalid sentry DSN, so just don't load Sentry on client + return ''; + } + $dsn_id = $matches[1]; + return <<