diff options
| author | Julia <julia@insertdomain.name> | 2025-04-28 19:15:54 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-29 08:15:54 +0900 |
| commit | d10fdfe9738b17a9d81037c031b40a2cc4cb8038 (patch) | |
| tree | 54eab11525d76e242bd5bd5b7e95bef48267f6fb /packages/frontend/src/widgets | |
| parent | New Crowdin updates (#15897) (diff) | |
| download | misskey-d10fdfe9738b17a9d81037c031b40a2cc4cb8038.tar.gz misskey-d10fdfe9738b17a9d81037c031b40a2cc4cb8038.tar.bz2 misskey-d10fdfe9738b17a9d81037c031b40a2cc4cb8038.zip | |
Merge commit from fork
* SP-2025-03.1 always wrap icon&thumbnail URLs
if they're not HTTP URLs, the frontend won't be able to display them
anyway (`<img src="mailto:…">` or '<div stile="background-image:
url(nntp:…)">` aren't going to work!), so let's always run them through the
media proxy, which will fail harder (fetching a `javascript:` URL
won't do anything in the backend, might do something in the frontend)
and will always protect the client's address in cases like `gemini:`
where the browser could try to fetch
* SP-2025-03.2 use object binding for more styles
interpolating a random (remote-controlled!) string into a `style`
attribute is a bad idea; using VueJS object binding, we should get
proper quoting and therefore safe parse failures instead of CSS
injections / XSS
* SP-2025-03.3 slightly more robust "self" URL handling
parse URLs instead of treating them as strings; this is still not
perfect, but the `URL` class only handles full URLs, not relative
ones, so there's so way to ask it "give me a URL object that
represents this resource relative to this base URL"
notice that passing very weird URLs to `MkUrl` and `MkUrlPreview` will
break the frontend (in dev mode) because there's an untrapped `new
URL(…)` that may explode; production builds seem to safely ignore the
error, though
---------
Co-authored-by: dakkar <dakkar@thenautilus.net>
Diffstat (limited to 'packages/frontend/src/widgets')
| -rw-r--r-- | packages/frontend/src/widgets/WidgetPhotos.vue | 2 | ||||
| -rw-r--r-- | packages/frontend/src/widgets/server-metric/cpu-mem.vue | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/packages/frontend/src/widgets/WidgetPhotos.vue b/packages/frontend/src/widgets/WidgetPhotos.vue index 5d6e2ed48f..6bbc52b2c2 100644 --- a/packages/frontend/src/widgets/WidgetPhotos.vue +++ b/packages/frontend/src/widgets/WidgetPhotos.vue @@ -14,7 +14,7 @@ SPDX-License-Identifier: AGPL-3.0-only <div v-for="(image, i) in images" :key="i" :class="$style.img" - :style="`background-image: url(${thumbnail(image)})`" + :style="{ backgroundImage: `url(${thumbnail(image)})` }" ></div> </div> </div> diff --git a/packages/frontend/src/widgets/server-metric/cpu-mem.vue b/packages/frontend/src/widgets/server-metric/cpu-mem.vue index 469075e2c4..614ffe59e3 100644 --- a/packages/frontend/src/widgets/server-metric/cpu-mem.vue +++ b/packages/frontend/src/widgets/server-metric/cpu-mem.vue @@ -34,7 +34,7 @@ SPDX-License-Identifier: AGPL-3.0-only <rect x="-2" y="-2" :width="viewBoxX + 4" :height="viewBoxY + 4" - :style="`stroke: none; fill: url(#${ cpuGradientId }); mask: url(#${ cpuMaskId })`" + :style="{ stroke: 'none', fill: `url(#${ cpuGradientId })`, mask: `url(#${ cpuMaskId })` }" /> <text x="1" y="5">CPU <tspan>{{ cpuP }}%</tspan></text> </svg> @@ -67,7 +67,7 @@ SPDX-License-Identifier: AGPL-3.0-only <rect x="-2" y="-2" :width="viewBoxX + 4" :height="viewBoxY + 4" - :style="`stroke: none; fill: url(#${ memGradientId }); mask: url(#${ memMaskId })`" + :style="{ stroke: 'none', fill: `url(#${ memGradientId })`, mask: `url(#${ memMaskId })` }" /> <text x="1" y="5">MEM <tspan>{{ memP }}%</tspan></text> </svg> |