api#347: передавать и настраивать UTM part без ссылки в Preland

This commit is contained in:
Panfilov Konstantin committed 2026-10-28 05:04:08 +03:00
1 parent 94619432a3
commit 0d350ed14b
23 files changed
+126 -47

No files matched your search

+3 -3
View File
@@ -1,16 +1,16 @@
<?php
declare(strict_types=1);
$root = dirname(__DIR__);
foreach (['light', 'dark'] as $theme) foreach ([
foreach (['abcd1','abcd2','abcd0','invalid'] as $part) foreach (['ru','en'] as $lang) foreach (['light', 'dark'] as $theme) foreach ([
'zoomstage.online' => 'zoomstage.online',
'New-Preland.example:8080' => 'new-preland.example',
'www.example.test.' => 'www.example.test',
'<script>alert(1)</script>' => 'fixture.local',
] as $host => $expected) {
$html = shell_exec(PHP_BINARY . ' ' . escapeshellarg(__DIR__ . '/render-preland.php') . ' ' . escapeshellarg($host) . ' ' . escapeshellarg($theme));
$html = shell_exec(PHP_BINARY . ' ' . escapeshellarg(__DIR__ . '/render-preland.php') . ' ' . escapeshellarg($host) . ' ' . escapeshellarg($theme) . ' ' . escapeshellarg($part) . ' ' . escapeshellarg($lang));
if (!preg_match('~<footer\b.*?</footer>~s', $html, $match)) throw new RuntimeException('Подвал не найден');
$footer = $match[0];
foreach (['Наши реквизиты', 'payment.svg', 'ИНН:', 'ОГРНИП:', 'ИП Иванов', 'ИП Кардаполова'] as $forbidden) {
foreach (['Наши реквизиты', 'payment.svg', 'ИНН:', 'ОГРНИП:', 'ИП Иванов', 'ИП Кардаполова', 'Для бизнеса', '/public/api-pricing'] as $forbidden) {
if (str_contains($footer, $forbidden)) throw new RuntimeException('В подвале остался ' . $forbidden);
}
if (!str_contains($footer, date('Y') . '© ' . $expected)) throw new RuntimeException('Неправильный домен копирайта: ' . $host);