forked from laysense/laysite
Prepare LaySite 1.4.5 site icons, Head settings and release images
This commit is contained in:
@@ -11,7 +11,7 @@ use Throwable;
|
||||
|
||||
final class Database
|
||||
{
|
||||
private const SCHEMA_VERSION = 7;
|
||||
private const SCHEMA_VERSION = 8;
|
||||
// Avoid reusing a deleted ID that may still be open in an editing form.
|
||||
public const NEXT_ARTICLE_ID = 'MAX(COALESCE((SELECT MAX(id) FROM articles), 0),
|
||||
COALESCE((SELECT MAX(article_id) FROM article_deletions), 0)) + 1';
|
||||
@@ -92,6 +92,9 @@ final class Database
|
||||
if ($version < 6 && !in_array('page_type', array_column($pdo->query('PRAGMA table_info(pages)')->fetchAll(), 'name'), true)) {
|
||||
$pdo->exec("ALTER TABLE pages ADD COLUMN page_type TEXT NOT NULL DEFAULT 'page' CHECK (page_type IN ('page', 'maintenance', 'not-found'))");
|
||||
}
|
||||
if ($version < 8 && !in_array('head_html', array_column($pdo->query('PRAGMA table_info(pages)')->fetchAll(), 'name'), true)) {
|
||||
$pdo->exec("ALTER TABLE pages ADD COLUMN head_html TEXT NOT NULL DEFAULT ''");
|
||||
}
|
||||
if ($version < 5) {
|
||||
LayoutPage::migrate($pdo);
|
||||
}
|
||||
|
||||
+24
-2
@@ -15,6 +15,8 @@ use Webman\Http\UploadFile;
|
||||
final class Media
|
||||
{
|
||||
public const MAX_BYTES = 64 * 1024 * 1024;
|
||||
private const MAX_CODE_BYTES = 2 * 1024 * 1024;
|
||||
private const CODE_TYPES = ['css' => 'text/css', 'js' => 'text/javascript'];
|
||||
|
||||
private const EXTENSIONS = [
|
||||
'image/png' => 'png', 'image/jpeg' => 'jpg', 'image/gif' => 'gif', 'image/webp' => 'webp',
|
||||
@@ -22,6 +24,7 @@ final class Media
|
||||
'video/mp4' => 'mp4', 'video/webm' => 'webm', 'video/quicktime' => 'mov',
|
||||
'audio/mpeg' => 'mp3', 'audio/ogg' => 'ogg', 'audio/wav' => 'wav',
|
||||
'application/pdf' => 'pdf', 'font/woff' => 'woff', 'font/woff2' => 'woff2',
|
||||
'text/css' => 'css', 'text/javascript' => 'js',
|
||||
];
|
||||
|
||||
public static function all(bool $includeArchived = false): array
|
||||
@@ -42,7 +45,7 @@ final class Media
|
||||
throw new RuntimeException('请选择大小不超过 64 MB 的有效文件。');
|
||||
}
|
||||
$source = $file->getPathname();
|
||||
$mime = (new \finfo(FILEINFO_MIME_TYPE))->file($source);
|
||||
$mime = self::mime($source, (string) $file->getUploadName(), $size);
|
||||
$extension = self::EXTENSIONS[$mime] ?? null;
|
||||
if ($extension === null) {
|
||||
throw new RuntimeException('文件类型不受支持。');
|
||||
@@ -105,7 +108,7 @@ final class Media
|
||||
|
||||
public static function validateBackup(string $path, string $name, string $mime, int $size): void
|
||||
{
|
||||
if ((new \finfo(FILEINFO_MIME_TYPE))->file($path) !== $mime
|
||||
if (self::mime($path, $name, $size) !== $mime
|
||||
|| !isset(self::EXTENSIONS[$mime]) || self::EXTENSIONS[$mime] !== pathinfo($name, PATHINFO_EXTENSION)) {
|
||||
throw new RuntimeException('备份资源类型与清单不一致。');
|
||||
}
|
||||
@@ -114,6 +117,25 @@ final class Media
|
||||
}
|
||||
}
|
||||
|
||||
private static function mime(string $path, string $name, int $size): string|false
|
||||
{
|
||||
$mime = (new \finfo(FILEINFO_MIME_TYPE))->file($path);
|
||||
$extension = strtolower(pathinfo($name, PATHINFO_EXTENSION));
|
||||
if (!isset(self::CODE_TYPES[$extension])) {
|
||||
return in_array($mime, self::CODE_TYPES, true) ? false : $mime;
|
||||
}
|
||||
if ($size > self::MAX_CODE_BYTES || !is_string($mime)
|
||||
|| (!str_starts_with($mime, 'text/') && !in_array($mime, ['application/javascript', 'application/json'], true))) {
|
||||
throw new RuntimeException('CSS 或 JavaScript 文件须为有效的 UTF-8 文本,且不超过 2 MB。');
|
||||
}
|
||||
$source = file_get_contents($path, length: self::MAX_CODE_BYTES + 1);
|
||||
if (!is_string($source) || strlen($source) !== $size || !mb_check_encoding($source, 'UTF-8') || str_contains($source, "\0")) {
|
||||
throw new RuntimeException('CSS 或 JavaScript 文件须为有效的 UTF-8 文本,且不超过 2 MB。');
|
||||
}
|
||||
|
||||
return self::CODE_TYPES[$extension];
|
||||
}
|
||||
|
||||
private static function safeSvg(string $source, int $size): string
|
||||
{
|
||||
if ($size > 512 * 1024) {
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Content;
|
||||
|
||||
use DOMDocument;
|
||||
use DOMElement;
|
||||
use RuntimeException;
|
||||
|
||||
final class PageHead
|
||||
{
|
||||
public const MAX_LENGTH = 32768;
|
||||
private const ATTRIBUTES = [
|
||||
'meta' => ['name', 'property', 'content'],
|
||||
'link' => ['rel', 'href', 'media', 'integrity', 'crossorigin', 'referrerpolicy'],
|
||||
'style' => ['media'],
|
||||
'script' => ['src', 'type', 'async', 'defer', 'integrity', 'crossorigin', 'referrerpolicy'],
|
||||
];
|
||||
|
||||
public static function normalize(mixed $value): string
|
||||
{
|
||||
if (!is_string($value) || strlen($value) > self::MAX_LENGTH || !mb_check_encoding($value, 'UTF-8') || str_contains($value, "\0")) {
|
||||
throw new RuntimeException('Head 代码须使用 UTF-8,最多 32 KB。');
|
||||
}
|
||||
$value = trim($value);
|
||||
self::parse($value);
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public static function render(array $sources, string $nonce, bool $canvas): array
|
||||
{
|
||||
$result = ['markup' => '', 'styles' => [], 'scripts' => [], 'inlineScript' => false, 'hasScript' => false];
|
||||
foreach ($sources as $source) {
|
||||
foreach (self::parse($source) as [$tag, $attributes, $text, $origin]) {
|
||||
if ($canvas && $tag === 'script') {
|
||||
continue;
|
||||
}
|
||||
if ($tag === 'script') {
|
||||
$result['hasScript'] = true;
|
||||
if (!isset($attributes['src'])) {
|
||||
$result['inlineScript'] = true;
|
||||
$attributes['nonce'] = $nonce;
|
||||
} elseif ($origin !== null) {
|
||||
$result['scripts'][$origin] = true;
|
||||
}
|
||||
}
|
||||
if ($tag === 'style') {
|
||||
$attributes['nonce'] = $nonce;
|
||||
} elseif ($tag === 'link' && $origin !== null) {
|
||||
$result['styles'][$origin] = true;
|
||||
}
|
||||
$markup = '<' . $tag;
|
||||
foreach ($attributes as $name => $value) {
|
||||
$markup .= " $name" . (in_array($name, ['async', 'defer'], true) ? '' : '="' . View::escape($value) . '"');
|
||||
}
|
||||
$result['markup'] .= $markup . '>' . ($text === null ? '' : $text . '</' . $tag . '>') . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private static function parse(string $source): array
|
||||
{
|
||||
if ($source === '') {
|
||||
return [];
|
||||
}
|
||||
$document = new DOMDocument('1.0', 'UTF-8');
|
||||
$document->loadHTML('<!doctype html><html><head><meta charset="utf-8">' . $source . '</head><body></body></html>',
|
||||
LIBXML_NONET | LIBXML_NOERROR | LIBXML_NOWARNING);
|
||||
$head = $document->getElementsByTagName('head')->item(0);
|
||||
$body = $document->getElementsByTagName('body')->item(0);
|
||||
if ($head === null || ($body !== null && ($body->childElementCount > 0 || trim($body->textContent) !== ''))) {
|
||||
throw new RuntimeException('Head 中只能填写文档头部的标签。');
|
||||
}
|
||||
|
||||
$entries = [];
|
||||
$origins = [];
|
||||
foreach ($head->childNodes as $node) {
|
||||
if ($node === $head->firstChild || $node->nodeType === XML_COMMENT_NODE
|
||||
|| ($node->nodeType === XML_TEXT_NODE && trim($node->textContent) === '')) {
|
||||
continue;
|
||||
}
|
||||
if (!$node instanceof DOMElement || !isset(self::ATTRIBUTES[$node->tagName]) || count($entries) >= 40) {
|
||||
throw new RuntimeException('Head 最多支持 40 个 meta、样式表、style 或 script 标签。');
|
||||
}
|
||||
$tag = $node->tagName;
|
||||
$attributes = [];
|
||||
foreach ($node->attributes as $attribute) {
|
||||
if (!in_array($attribute->name, self::ATTRIBUTES[$tag], true)) {
|
||||
throw new RuntimeException('Head 标签包含不支持的属性:' . $attribute->name . '。');
|
||||
}
|
||||
$attributes[$attribute->name] = $attribute->value;
|
||||
}
|
||||
$text = in_array($tag, ['script', 'style'], true) ? $node->textContent : null;
|
||||
if ($text !== null && preg_match('~<(?:!--|/?\s*(?:script|style)\b)~i', $text)) {
|
||||
throw new RuntimeException('内联代码含有可能中断 HTML 解析的标记,请将代码放到独立文件中。');
|
||||
}
|
||||
$origin = null;
|
||||
if ($tag === 'meta' && ((!isset($attributes['name']) && !isset($attributes['property'])) || !isset($attributes['content']))) {
|
||||
throw new RuntimeException('meta 标签须填写 name 或 property,以及 content。');
|
||||
}
|
||||
if ($tag === 'link') {
|
||||
if (strtolower($attributes['rel'] ?? '') !== 'stylesheet') {
|
||||
throw new RuntimeException('Head 中的 link 标签仅用于加载样式表。');
|
||||
}
|
||||
$origin = self::origin($attributes['href'] ?? '');
|
||||
} elseif ($tag === 'script') {
|
||||
if (!in_array(strtolower($attributes['type'] ?? ''), ['', 'text/javascript', 'module', 'application/ld+json'], true)) {
|
||||
throw new RuntimeException('script 类型须为 JavaScript、module 或 application/ld+json。');
|
||||
}
|
||||
if (isset($attributes['src'])) {
|
||||
if (trim($text) !== '') {
|
||||
throw new RuntimeException('有 src 的 script 标签应留空内容。');
|
||||
}
|
||||
$origin = self::origin($attributes['src']);
|
||||
}
|
||||
}
|
||||
if ($origin !== null) {
|
||||
$origins[$origin] = true;
|
||||
if (count($origins) > 8) {
|
||||
throw new RuntimeException('一处 Head 设置最多可以引用 8 个 HTTPS 来源。');
|
||||
}
|
||||
}
|
||||
$entries[] = [$tag, $attributes, $text, $origin];
|
||||
}
|
||||
|
||||
return $entries;
|
||||
}
|
||||
|
||||
private static function origin(string $url): ?string
|
||||
{
|
||||
if (strlen($url) <= 2048 && Html::url($url, true)) {
|
||||
if (str_starts_with($url, '/')) {
|
||||
return null;
|
||||
}
|
||||
$parts = parse_url($url);
|
||||
if (filter_var($url, FILTER_VALIDATE_URL) && isset($parts['host']) && !isset($parts['user']) && !isset($parts['pass'])
|
||||
&& preg_match('/^[a-z0-9.-]+$/iD', $parts['host'])) {
|
||||
return 'https://' . strtolower($parts['host']) . (isset($parts['port']) ? ':' . $parts['port'] : '');
|
||||
}
|
||||
}
|
||||
|
||||
throw new RuntimeException('样式表和脚本地址须使用以 / 开头的站内路径或完整 HTTPS 网址。');
|
||||
}
|
||||
}
|
||||
@@ -133,12 +133,13 @@ final class Repository
|
||||
{
|
||||
Database::write(function (PDO $pdo) use ($slug, $data, $version, $sections, $replaceDraftSections, $sectionOrder): void {
|
||||
$query = $pdo->prepare('UPDATE pages SET name = ?, title = ?, description = ?, heading = ?, accent = ?, lead = ?,
|
||||
image = ?, alt = ?, image_scale = ?, alignments = ?, actions = ?, quicklinks = ?, visibility = ?, header_id = ?, footer_id = ?, palette_id = ?, status = ?, updated_at = ?, presentation = COALESCE(?, presentation), version = version + 1 WHERE slug = ? AND version = ?');
|
||||
image = ?, alt = ?, image_scale = ?, alignments = ?, actions = ?, quicklinks = ?, visibility = ?, header_id = ?, footer_id = ?, palette_id = ?, status = ?, updated_at = ?,
|
||||
presentation = COALESCE(?, presentation), head_html = COALESCE(?, head_html), version = version + 1 WHERE slug = ? AND version = ?');
|
||||
$query->execute([
|
||||
$data['name'], $data['title'], $data['description'], $data['heading'], $data['accent'], $data['lead'],
|
||||
$data['image'], $data['alt'], $data['image_scale'], Database::json($data['alignments']), Database::json($data['actions']), Database::json($data['quicklinks']),
|
||||
Database::json($data['visibility']), $data['header_id'], $data['footer_id'], $data['palette_id'], $data['status'], self::now(),
|
||||
isset($data['presentation']) ? CanvasStyle::encode($data['presentation']) : null, $slug, $version,
|
||||
isset($data['presentation']) ? CanvasStyle::encode($data['presentation']) : null, $data['head_html'] ?? null, $slug, $version,
|
||||
]);
|
||||
self::checkVersion($query->rowCount());
|
||||
if ($data['status'] === 'draft' && str_starts_with($slug, 'system--')) {
|
||||
|
||||
@@ -12,7 +12,7 @@ use Throwable;
|
||||
final class SiteBackup
|
||||
{
|
||||
private const FORMAT = 'laysite-site';
|
||||
private const VERSION = 4;
|
||||
private const VERSION = 5;
|
||||
private const TABLES = [
|
||||
'site_settings', 'design_presets', 'pages', 'sections', 'article_categories', 'articles',
|
||||
'article_category_links', 'article_redirects', 'article_deletions', 'media',
|
||||
@@ -140,7 +140,7 @@ final class SiteBackup
|
||||
private static function prepare(mixed $manifest): array
|
||||
{
|
||||
if (!is_array($manifest) || ($manifest['format'] ?? '') !== self::FORMAT
|
||||
|| !in_array($manifest['version'] ?? null, [1, 2, 3, self::VERSION], true) || !is_array($manifest['tables'] ?? null)) {
|
||||
|| !in_array($manifest['version'] ?? null, [1, 2, 3, 4, self::VERSION], true) || !is_array($manifest['tables'] ?? null)) {
|
||||
throw new RuntimeException('备份格式不受支持,请使用相同或更新版本的 LaySite。');
|
||||
}
|
||||
$tables = $manifest['tables'];
|
||||
@@ -172,6 +172,8 @@ final class SiteBackup
|
||||
throw new RuntimeException('备份的站点名称无效。');
|
||||
}
|
||||
$site = ['name' => $settings['name'], 'cdn' => ['origin' => Assets::cdn($settings['cdn']['origin'] ?? '')], 'revisions' => ['general' => time()]];
|
||||
$site['head_html'] = PageHead::normalize($settings['head_html'] ?? '');
|
||||
$site['favicon'] = SiteIcon::normalize($settings['favicon'] ?? '');
|
||||
$layoutDefaults = $settings['layout_defaults'] ?? [];
|
||||
if (!is_array($layoutDefaults)) {
|
||||
throw new RuntimeException('备份的基础页头页脚配置无效。');
|
||||
@@ -210,6 +212,7 @@ final class SiteBackup
|
||||
$row['visibility'] = Database::json(array_intersect_key(self::decode($row['visibility'] ?? '{}'), array_flip(['header', 'hero', 'footer'])));
|
||||
$row['alignments'] = Database::json(self::decode($row['alignments'] ?? '{}'));
|
||||
$row['presentation'] = CanvasStyle::encode(CanvasStyle::normalize(self::decode($row['presentation'] ?? '{}'), CanvasStyle::PAGE));
|
||||
$row['head_html'] = $layout === null ? PageHead::normalize($row['head_html'] ?? '') : '';
|
||||
if (($row['theme'] ?? '') !== '' && !isset(PageTemplates::groups()[$row['theme']])) {
|
||||
$row['theme'] = '';
|
||||
}
|
||||
|
||||
@@ -31,9 +31,10 @@ final class SiteDesign
|
||||
return implode("\n", array_map(static fn (array $link): string => $link[1] . ' | ' . $link[0], $links));
|
||||
}
|
||||
|
||||
public static function saveGeneral(string $name, string $origin, int $version, array $systemPages, bool $maintenance): void
|
||||
public static function saveGeneral(string $name, string $origin, int $version, array $systemPages, bool $maintenance,
|
||||
?string $head = null, ?string $icon = null): void
|
||||
{
|
||||
Database::write(function (PDO $pdo) use ($name, $origin, $version, $systemPages, $maintenance): void {
|
||||
Database::write(function (PDO $pdo) use ($name, $origin, $version, $systemPages, $maintenance, $head, $icon): void {
|
||||
$site = json_decode((string) $pdo->query('SELECT payload FROM site_settings WHERE id = 1')->fetchColumn(), true, flags: JSON_THROW_ON_ERROR);
|
||||
if (($site['revisions']['general'] ?? 0) !== $version) {
|
||||
throw new RuntimeException('站点设置已更新,请重新打开后再保存。');
|
||||
@@ -51,6 +52,12 @@ final class SiteDesign
|
||||
$site['cdn'] = ['origin' => $origin];
|
||||
$site['system_pages'] = $systemPages;
|
||||
$site['maintenance_enabled'] = $maintenance;
|
||||
if ($head !== null) {
|
||||
$site['head_html'] = $head;
|
||||
}
|
||||
if ($icon !== null) {
|
||||
$site['favicon'] = $icon;
|
||||
}
|
||||
$site['revisions']['general'] = $version + 1;
|
||||
$pdo->prepare('UPDATE site_settings SET payload = ? WHERE id = 1')->execute([Database::json($site)]);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Content;
|
||||
|
||||
use RuntimeException;
|
||||
use support\Response;
|
||||
|
||||
final class SiteIcon
|
||||
{
|
||||
public const SIZE = 64;
|
||||
public const PATH = '/.laysite/favicon.png';
|
||||
|
||||
public static function normalize(mixed $value): string
|
||||
{
|
||||
if ($value === '') {
|
||||
return '';
|
||||
}
|
||||
$bytes = is_string($value) && strlen($value) <= 44000 ? base64_decode($value, true) : false;
|
||||
$size = $bytes === false || $bytes === '' ? false : @getimagesizefromstring($bytes);
|
||||
if (!$size || $size[2] !== IMAGETYPE_PNG || $size[0] !== self::SIZE || $size[1] !== self::SIZE) {
|
||||
throw new RuntimeException('请裁剪并生成一个 64 × 64 的 PNG 图标。');
|
||||
}
|
||||
|
||||
return base64_encode($bytes);
|
||||
}
|
||||
|
||||
public static function url(string $icon): string
|
||||
{
|
||||
return $icon === '' ? Assets::DEFAULT_ICON : self::PATH . '?v=' . substr(hash('sha256', $icon), 0, 16);
|
||||
}
|
||||
|
||||
public static function response(string $icon, bool $ico): Response
|
||||
{
|
||||
if ($icon === '') {
|
||||
return View::redirect(Assets::DEFAULT_ICON, 301);
|
||||
}
|
||||
$bytes = base64_decode($icon, true);
|
||||
if ($bytes === false) {
|
||||
return View::redirect(Assets::DEFAULT_ICON, 302);
|
||||
}
|
||||
if ($ico) {
|
||||
$bytes = pack('vvvCCCCvvVV', 0, 1, 1, self::SIZE, self::SIZE, 0, 0, 1, 32, strlen($bytes), 22) . $bytes;
|
||||
}
|
||||
|
||||
return new Response(200, [
|
||||
'Content-Type' => $ico ? 'image/x-icon' : 'image/png',
|
||||
'Cache-Control' => 'public, max-age=300',
|
||||
'X-Content-Type-Options' => 'nosniff',
|
||||
], $bytes);
|
||||
}
|
||||
}
|
||||
+14
-4
@@ -50,12 +50,21 @@ final class View
|
||||
}
|
||||
$html = self::fragment($template, $data);
|
||||
$data['canvasColors'] = $admin ? '' : CanvasStyle::colorRules($html . ($data['headerMarkup'] ?? '') . ($data['footerMarkup'] ?? ''));
|
||||
$data['styleNonce'] = $data['canvasColors'] !== '' || !empty($data['canvas']) ? base64_encode(random_bytes(18)) : '';
|
||||
$headSources = $admin ? [] : array_filter([$data['site']['head_html'] ?? '', $data['page']['head_html'] ?? '']);
|
||||
$data['styleNonce'] = $data['canvasColors'] !== '' || !empty($data['canvas']) || $headSources !== []
|
||||
? base64_encode(random_bytes(18)) : '';
|
||||
$head = PageHead::render($headSources, $data['styleNonce'], !empty($data['canvas']));
|
||||
$data['headMarkup'] = $head['markup'];
|
||||
$page = Assets::rewrite(self::fragment($admin ? 'admin-layout' : 'layout', $data + ['content' => $html]), $cdn);
|
||||
$assetSources = $cdn === '' ? "'self'" : "'self' " . $cdn;
|
||||
$styleSources = $assetSources . ($data['styleNonce'] === '' ? '' : " 'nonce-{$data['styleNonce']}'");
|
||||
$styleSources .= $head['styles'] === [] ? '' : ' ' . implode(' ', array_keys($head['styles']));
|
||||
$scriptSources = $assetSources . ($head['scripts'] === [] ? '' : ' ' . implode(' ', array_keys($head['scripts'])));
|
||||
if ($head['inlineScript']) {
|
||||
$scriptSources .= " 'nonce-{$data['styleNonce']}'";
|
||||
}
|
||||
$articleEditor = $admin && !empty($data['articleEditor']);
|
||||
$editorImages = $articleEditor ? ' data:' : '';
|
||||
$editorImages = ($articleEditor ? ' data:' : '') . ($admin && !empty($data['faviconEditor']) ? ' blob:' : '');
|
||||
$editorStyles = $articleEditor ? "style-src-attr 'unsafe-inline'; " : '';
|
||||
$headers = [
|
||||
'Content-Type' => 'text/html; charset=utf-8',
|
||||
@@ -63,8 +72,9 @@ final class View
|
||||
'Referrer-Policy' => 'strict-origin-when-cross-origin',
|
||||
'X-Frame-Options' => !empty($data['previewMode']) ? 'SAMEORIGIN' : 'DENY',
|
||||
'Content-Security-Policy' => "default-src 'self'; img-src 'self' https:$editorImages; media-src 'self' https:; "
|
||||
. "style-src $styleSources; {$editorStyles}script-src $assetSources; font-src $assetSources; frame-src 'self'; frame-ancestors "
|
||||
. (!empty($data['previewMode']) ? "'self'" : "'none'") . "; form-action 'self'; base-uri 'none'; object-src 'none'",
|
||||
. "style-src $styleSources; {$editorStyles}script-src $scriptSources; font-src $assetSources; frame-src 'self'; frame-ancestors "
|
||||
. (!empty($data['previewMode']) ? "'self'" : "'none'") . "; form-action 'self'; base-uri 'none'; object-src 'none'"
|
||||
. ($head['hasScript'] && !empty($data['previewMode']) ? '; sandbox allow-scripts allow-popups' : ''),
|
||||
];
|
||||
if ($admin || !empty($data['previewMode'])) {
|
||||
$headers['Cache-Control'] = 'no-store';
|
||||
|
||||
Reference in New Issue
Block a user