Skip to content

EspoCRM – Open Source CRM Application

Cast string to int, if PDO improperly returned string

Yurii3ea418bbe26d
diff --git a/application/Espo/Tools/Notification/RecordService.php b/application/Espo/Tools/Notification/RecordService.php
index 801d6edda2..06a9aea7a4 100644
--- a/application/Espo/Tools/Notification/RecordService.php
+++ b/application/Espo/Tools/Notification/RecordService.php
@@ -299,6 +299,10 @@ class RecordService
$count = $row['c'] ?? null;
+ if (is_string($count) && is_numeric($count)) {
+ $count = (int) $count;
+ }
+
if (!is_int($count)) {
throw new UnexpectedValueException();
}