feat: готовый бренд ZoomStage и минимальный доменный подвал (refs #12)
deploy-preland / deploy zoomstage.online (push) Successful in 44s
deploy-preland / deploy zoomstage.online (push) Successful in 44s
This commit is contained in:
1 parent
a2c3197a16
commit
ec087ea636
24 files changed
+365
-237
No files matched your search
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
/** Домен преленда не связан с config.host основного сайта/API. */
|
||||
function prelandSiteDomain(array $server): string
|
||||
{
|
||||
foreach ([$server['HTTP_HOST'] ?? '', $server['SERVER_NAME'] ?? ''] as $candidate) {
|
||||
if (!is_string($candidate) || preg_match('/[\s\/@?#<>]/', $candidate)) continue;
|
||||
$host = strtolower(rtrim(preg_replace('/:\d+$/', '', $candidate), '.'));
|
||||
if (strlen($host) <= 253 && preg_match('/^(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/D', $host)) return $host;
|
||||
}
|
||||
return '';
|
||||
}
|
||||
Reference in new issue
Block a user