From 12fe09c6e7c204c5b064eab2c8eda7329ff3a7a3 Mon Sep 17 00:00:00 2001 From: CyberRex Date: Sat, 21 Oct 2023 18:38:51 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=95=E3=82=A3=E3=83=BC?= =?UTF-8?q?=E3=83=AB=E3=81=AEURL=E8=AA=8D=E8=A8=BC=E3=82=92rel=3Dme?= =?UTF-8?q?=E3=81=A7=E5=8F=AF=E8=83=BD=E3=81=AB=20(#12100)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/server/api/endpoints/i/update.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/i/update.ts b/packages/backend/src/server/api/endpoints/i/update.ts index f1837e708..79ead57a6 100644 --- a/packages/backend/src/server/api/endpoints/i/update.ts +++ b/packages/backend/src/server/api/endpoints/i/update.ts @@ -437,9 +437,13 @@ export default class extends Endpoint { // eslint- const myLink = `${this.config.url}/@${user.username}`; - const includesMyLink = Array.from(doc.getElementsByTagName('a')).some(a => a.href === myLink); + const aEls = Array.from(doc.getElementsByTagName('a')); + const linkEls = Array.from(doc.getElementsByTagName('link')); - if (includesMyLink) { + const includesMyLink = aEls.some(a => a.href === myLink); + const includesRelMeLinks = [...aEls, ...linkEls].some(link => link.rel === 'me' && link.href === myLink); + + if (includesMyLink || includesRelMeLinks) { await this.userProfilesRepository.createQueryBuilder('profile').update() .where('userId = :userId', { userId: user.id }) .set({