Always prefer stricter string comparisons.

This commit is contained in:
Lucas Michot
2024-10-31 15:23:19 +01:00
parent 79d5434da2
commit 601f1a4717
25 changed files with 55 additions and 55 deletions

View File

@@ -281,7 +281,7 @@ class StandalonePostgresql extends BaseModel
if (str($metrics)->contains('error')) {
$error = json_decode($metrics, true);
$error = data_get($error, 'error', 'Something is not okay, are you okay?');
if ($error == 'Unauthorized') {
if ($error === 'Unauthorized') {
$error = 'Unauthorized, please check your metrics token or restart Sentinel to set a new token.';
}
throw new \Exception($error);
@@ -303,7 +303,7 @@ class StandalonePostgresql extends BaseModel
if (str($metrics)->contains('error')) {
$error = json_decode($metrics, true);
$error = data_get($error, 'error', 'Something is not okay, are you okay?');
if ($error == 'Unauthorized') {
if ($error === 'Unauthorized') {
$error = 'Unauthorized, please check your metrics token or restart Sentinel to set a new token.';
}
throw new \Exception($error);