Sanitize print logs; refactor popular plugin logic
Some checks are pending
Build And Publish Docker Images / plan (push) Waiting to run
Build And Publish Docker Images / build (push) Blocked by required conditions

Ensure printed output and HTML logs are safe by importing and applying sanitize_string, opening log files with utf-8 and errors='replace', and sanitizing text before writing. Add tests to verify lone surrogate characters are replaced and that logging won't crash on invalid Unicode. In the plugin installer UI, introduce POPULAR_PLUGIN_MIN_STARS and centralize popularity checking in _isPopularPlugin, using it for filtering and counts.
This commit is contained in:
frdel 2026-03-30 11:50:59 +02:00
parent 430f8479a9
commit 44e008745d
6 changed files with 272 additions and 11 deletions

View file

@ -25,6 +25,12 @@
<div class="pi-hero-main">
<h2 class="pi-hero-title" x-text="$store.pluginInstallStore.selectedPlugin.title || $store.pluginInstallStore.selectedPlugin.key"></h2>
<div class="pi-status-badges">
<template x-if="$store.pluginInstallStore.selectedPlugin.suspended">
<span class="pi-card-suspended-pill">
<span class="material-symbols-outlined">priority_high</span>
<span>Suspended</span>
</span>
</template>
<template x-if="$store.pluginInstallStore.selectedPlugin.installed">
<span class="pi-card-installed-pill">Installed</span>
</template>
@ -100,6 +106,17 @@
</div>
</div>
<template x-if="$store.pluginInstallStore.selectedPlugin.suspended">
<div class="pi-suspension-banner">
<span class="material-symbols-outlined">priority_high</span>
<div class="pi-suspension-banner-copy">
<div class="pi-suspension-banner-title">Plugin has been suspended for the following reasons:</div>
<div class="pi-suspension-banner-explanation"
x-text="$store.pluginInstallStore.selectedPlugin.suspended"></div>
</div>
</div>
</template>
<div class="pi-description" x-text="$store.pluginInstallStore.selectedPlugin.description || 'No description available.'"></div>
<div class="pi-screenshots-section"
@ -435,6 +452,27 @@
color: #1d4ed8;
}
.pi-card-suspended-pill {
display: inline-flex;
align-items: center;
gap: 0.3rem;
padding: 0.24rem 0.5rem;
border-radius: 0.5rem;
background: rgba(245, 158, 11, 0.16);
color: #f59e0b;
font-size: 0.72rem;
font-weight: 700;
}
.pi-card-suspended-pill .material-symbols-outlined {
font-size: 0.95rem;
}
body.light-mode .pi-card-suspended-pill {
background: rgba(245, 158, 11, 0.2);
color: #b45309;
}
.pi-status-badges .pi-card-installed-pill {
position: static;
top: auto;
@ -447,6 +485,12 @@
right: auto;
}
.pi-status-badges .pi-card-suspended-pill {
position: static;
top: auto;
right: auto;
}
.pi-tag {
display: inline-flex;
align-items: center;
@ -466,6 +510,47 @@
margin-bottom: 1.5rem;
}
.pi-suspension-banner {
display: flex;
align-items: flex-start;
gap: 0.75rem;
margin-bottom: 1rem;
padding: 0.9rem 1rem;
border: 1px solid rgba(245, 158, 11, 0.32);
border-radius: 10px;
background: rgba(245, 158, 11, 0.12);
color: #f59e0b;
}
.pi-suspension-banner .material-symbols-outlined {
font-size: 1.2rem;
line-height: 1.2;
flex-shrink: 0;
}
.pi-suspension-banner-copy {
min-width: 0;
}
.pi-suspension-banner-title {
font-size: 0.92rem;
font-weight: 700;
line-height: 1.45;
}
.pi-suspension-banner-explanation {
margin-top: 0.2rem;
font-size: 0.92rem;
line-height: 1.55;
white-space: pre-line;
}
body.light-mode .pi-suspension-banner {
border-color: rgba(217, 119, 6, 0.28);
background: rgba(245, 158, 11, 0.14);
color: #b45309;
}
.pi-actions-primary {
display: flex;
gap: 0.75rem;