-
+
diff --git a/packages/frontend/src/components/MkUserPopup.vue b/packages/frontend/src/components/MkUserPopup.vue
index 41b27a1af..37864258a 100644
--- a/packages/frontend/src/components/MkUserPopup.vue
+++ b/packages/frontend/src/components/MkUserPopup.vue
@@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
>
{ emit('mouseover'); }" @mouseleave="() => { emit('mouseleave'); }">
-
+
MEM {{ memP }}%
From 80b4272c5730fbef693addea0fd90b74542aa6cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?=
<67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Tue, 29 Apr 2025 15:54:57 +0900
Subject: [PATCH 2/3] fix(frontend): fix lint (#15906)
(cherry picked from commit f8b0863b8edf18dac9188a93a52c4d149eabb0e9)
* fix(frontend): attempt to fix lint
* fix lint
---
packages/frontend/src/scripts/collapsed.ts | 36 +++++++++++++++-------
packages/frontend/src/scripts/url.ts | 2 +-
2 files changed, 26 insertions(+), 12 deletions(-)
diff --git a/packages/frontend/src/scripts/collapsed.ts b/packages/frontend/src/scripts/collapsed.ts
index 237bd37c7..aa24c43bc 100644
--- a/packages/frontend/src/scripts/collapsed.ts
+++ b/packages/frontend/src/scripts/collapsed.ts
@@ -6,16 +6,30 @@
import * as Misskey from 'misskey-js';
export function shouldCollapsed(note: Misskey.entities.Note, urls: string[]): boolean {
- const collapsed = note.cw == null && note.text != null && (
- (note.text.includes('$[x2')) ||
- (note.text.includes('$[x3')) ||
- (note.text.includes('$[x4')) ||
- (note.text.includes('$[scale')) ||
- (note.text.split('\n').length > 9) ||
- (note.text.length > 500) ||
- (note.files.length >= 5) ||
- (urls.length >= 4)
- );
+ if (note.cw != null) {
+ return false;
+ }
- return collapsed;
+ if (note.text != null) {
+ if (
+ note.text.includes('$[x2') ||
+ note.text.includes('$[x3') ||
+ note.text.includes('$[x4') ||
+ note.text.includes('$[scale') ||
+ note.text.split('\n').length > 9 ||
+ note.text.length > 500
+ ) {
+ return true;
+ }
+ }
+
+ if (urls.length >= 4) {
+ return true;
+ }
+
+ if (note.files != null && note.files.length >= 5) {
+ return true;
+ }
+
+ return false;
}
diff --git a/packages/frontend/src/scripts/url.ts b/packages/frontend/src/scripts/url.ts
index 4b9d20333..7653802a9 100644
--- a/packages/frontend/src/scripts/url.ts
+++ b/packages/frontend/src/scripts/url.ts
@@ -40,7 +40,7 @@ export function maybeMakeRelative(urlStr: string, baseStr: string): string {
return urlObj.pathname + urlObj.search + urlObj.hash;
}
return urlStr;
- } catch (e) {
+ } catch {
return '';
}
}
From fe90cc7b24cdb5749403036556707a9c60b1c2db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=82=E3=82=8F=E3=82=8F=E3=82=8F=E3=81=A8=E3=83=BC?=
=?UTF-8?q?=E3=81=AB=E3=82=85?=
<17376330+u1-liquid@users.noreply.github.com>
Date: Thu, 1 May 2025 21:24:38 +0900
Subject: [PATCH 3/3] Merge commit from fork
(cherry picked from commit 583df3ec63e25a1fd34def0dac13405396b8b663)
none of our endpoints will ever contain `..` (they might, maybe, at
some point, contain `.`, as in `something/get.html`?), so every
`Mk:api()` call to an endpoint that contains `..` can't work: let's
reject it outright
Co-authored-by: Julia
Co-authored-by: dakkar
---
packages/frontend/src/scripts/aiscript/api.ts | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/packages/frontend/src/scripts/aiscript/api.ts b/packages/frontend/src/scripts/aiscript/api.ts
index 15d1cfc03..525b0540b 100644
--- a/packages/frontend/src/scripts/aiscript/api.ts
+++ b/packages/frontend/src/scripts/aiscript/api.ts
@@ -51,7 +51,9 @@ export function createAiScriptEnv(opts) {
}),
'Mk:api': values.FN_NATIVE(async ([ep, param, token]) => {
utils.assertString(ep);
- if (ep.value.includes('://')) throw new Error('invalid endpoint');
+ if (ep.value.includes('://') || ep.value.includes('..')) {
+ throw new Error('invalid endpoint');
+ }
if (token) {
utils.assertString(token);
// バグがあればundefinedもあり得るため念のため
{{ i18n.ts.followsYou }}
@@ -67,7 +67,7 @@ SPDX-License-Identifier: AGPL-3.0-only