From e27997dcbc11b8d9405cf3c1a7124f59e6de6a88 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Sat, 9 May 2026 12:06:09 +1200 Subject: [PATCH] Update src/Appwrite/Insights/Validator/CTAs.php Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- src/Appwrite/Insights/Validator/CTAs.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Appwrite/Insights/Validator/CTAs.php b/src/Appwrite/Insights/Validator/CTAs.php index 848253bc13..8f0457f33c 100644 --- a/src/Appwrite/Insights/Validator/CTAs.php +++ b/src/Appwrite/Insights/Validator/CTAs.php @@ -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'])) {