Update src/Appwrite/Insights/Validator/CTAs.php

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
This commit is contained in:
Jake Barnby
2026-05-09 12:06:09 +12:00
committed by GitHub
co-authored by greptile-apps[bot]
parent 6b64eb85b3
commit e27997dcbc
+6 -1
View File
@@ -45,10 +45,15 @@ class CTAs extends Validator
return false;
}
foreach (['label', 'service', 'method'] as $required) {
$maxLengths = ['label' => 256, 'service' => 64, 'method' => 64];
foreach ($maxLengths as $required => $maxLength) {
if (!isset($entry[$required]) || !\is_string($entry[$required]) || $entry[$required] === '') {
return false;
}
if (\strlen($entry[$required]) > $maxLength) {
$this->message = "CTA `{$required}` must not exceed {$maxLength} characters.";
return false;
}
}
if (isset($entry['params']) && !\is_array($entry['params']) && !\is_object($entry['params'])) {