File: //proc/thread-self/root/tmp/cs-sound-ready-create-setup.patch
*** Begin Patch
*** Update File: /home/kiwerkzeuge.de/public_html/creator-studio/_lib/bootstrap.php
@@
$template = cs_photo_carousel_template($templateId);
$templateId = (string) $template['template_id'];
+ $delivery = cs_photo_carousel_delivery_mode((string) ($input['delivery_mode'] ?? 'photo_media_upload'));
+ $deliveryMode = (string) $delivery['mode'];
+ $ctaUrl = trim((string) ($input['cta_url'] ?? ''));
+ if ($ctaUrl !== '') {
+ $ctaUrl = cs_validate_https_url($ctaUrl, 'CTA URL');
+ }
+ $ctaHost = '';
+ if ($ctaUrl !== '') {
+ $host = parse_url($ctaUrl, PHP_URL_HOST);
+ $ctaHost = is_string($host) ? strtolower($host) : '';
+ }
+ $soundDirection = cs_clean_lead_text($input['sound_direction'] ?? '', 240);
+ if ($soundDirection === '' && $deliveryMode === 'sound_ready_mp4') {
+ $soundDirection = 'Brand-safe upbeat bed embedded into the vertical MP4 before TikTok handoff.';
+ }
+ $visibleUrlRequired = cs_notification_bool_value($input['visible_url_required'] ?? ($deliveryMode === 'sound_ready_mp4'), $deliveryMode === 'sound_ready_mp4');
+ $qrRequired = cs_notification_bool_value($input['qr_required'] ?? ($deliveryMode === 'sound_ready_mp4'), $deliveryMode === 'sound_ready_mp4');
+ $aiDisclosureRequired = cs_notification_bool_value($input['ai_disclosure_required'] ?? true, true);
+ if ($deliveryMode === 'sound_ready_mp4' && ($visibleUrlRequired || $qrRequired) && $ctaUrl === '') {
+ throw new RuntimeException('Sound-ready MP4 briefs need a CTA URL when visible URL or QR is required.');
+ }
$coverIndex = max(0, min((int) ($input['cover_index'] ?? 0), count($imageUrls) - 1));
*** End Patch