From 7279b18fdce051160dde1d23aa54189e907ede76 Mon Sep 17 00:00:00 2001 From: jay Date: Fri, 12 Jun 2026 21:58:13 -0400 Subject: [PATCH] Articles inspector hardening (Codex audit): http(s)-only links + clamp reason MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Article titles render as external links ONLY for http(s) URLs (matches ArticleCard's safeHref rule); anything else is plain text — no unsafe schemes. - reason_text clamped to 2 lines with a full-text title tooltip, so a long classifier reason can't make the panel visually noisy. (Admin gate + source-scoped query confirmed already in place.) --- frontend/src/routes/admin/+page.svelte | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/routes/admin/+page.svelte b/frontend/src/routes/admin/+page.svelte index 2429d8a..2dd1f0d 100644 --- a/frontend/src/routes/admin/+page.svelte +++ b/frontend/src/routes/admin/+page.svelte @@ -743,7 +743,9 @@ {#each s._arts as a (a.id)}
  • - {a.title} + {#if typeof a.url === 'string' && /^https?:\/\//.test(a.url)} + {a.title} + {:else}{a.title}{/if} {#if a.accepted === 1}accepted{:else if a.accepted === 0}rejected{/if} {#if a.paywalled}🔒{/if} {#if !a.has_image}no img{/if} @@ -751,7 +753,7 @@ {#if a.topic}{a.topic}{/if} {a.published_at ? fdate(a.published_at) : ''}
    - {#if a.reason}
    {a.reason}
    {/if} + {#if a.reason}
    {a.reason}
    {/if}
  • {/each} @@ -1273,7 +1275,9 @@ .art-flag { font-size: 0.7rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; } .art-cat { font-size: 0.72rem; color: var(--muted); text-transform: capitalize; } .art-when { font-size: 0.72rem; color: var(--muted); margin-left: auto; white-space: nowrap; } - .art-reason { font-size: 0.76rem; color: var(--muted); font-style: italic; margin-top: 2px; } + .art-title.plain { color: var(--ink); font-weight: 600; } + .art-reason { font-size: 0.76rem; color: var(--muted); font-style: italic; margin-top: 2px; + display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: help; } .act.more { margin-top: 8px; } .srctable .rowactions { white-space: nowrap; } .srctable .rowactions .act {