From 0f8412607ca5b4e838a055c0654e7ea41a79b15f Mon Sep 17 00:00:00 2001 From: Mortifia Date: Sat, 25 Jul 2026 02:44:38 +0200 Subject: [PATCH] fix: replaceAll au lieu de replace pour retirer tous les \r MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit .replace('\r', '') ne retirait que la première occurrence — sans impact réel ici (scripts de génération de contenu exécutés localement hors-ligne, jamais côté serveur), mais un vrai bug de correction relevé par CodeQL (js/incomplete-sanitization). Closes #335 --- .../4_Univers/tools/craftableLister/constructionLister.js | 2 +- docs/4_Univers/tools/craftableLister/textureCrawler.js | 8 ++++---- .../4_Univers/tools/craftableLister/constructionLister.js | 2 +- .../4_Univers/tools/craftableLister/textureCrawler.js | 8 ++++---- .../4_Univers/tools/craftableLister/constructionLister.js | 2 +- .../4_Univers/tools/craftableLister/textureCrawler.js | 8 ++++---- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/docs/4_Univers/tools/craftableLister/constructionLister.js b/docs/4_Univers/tools/craftableLister/constructionLister.js index 0476e8da..68749f2b 100755 --- a/docs/4_Univers/tools/craftableLister/constructionLister.js +++ b/docs/4_Univers/tools/craftableLister/constructionLister.js @@ -60,7 +60,7 @@ const init = () => { .split('propertyPath: initialName')[1] ?.split('value: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); const spriteId = buildingMaterial.rawText .split('propertyPath: m_Sprite')[1] diff --git a/docs/4_Univers/tools/craftableLister/textureCrawler.js b/docs/4_Univers/tools/craftableLister/textureCrawler.js index 947205af..bf53b450 100755 --- a/docs/4_Univers/tools/craftableLister/textureCrawler.js +++ b/docs/4_Univers/tools/craftableLister/textureCrawler.js @@ -91,13 +91,13 @@ const crawlPrefabs = (basePath) => { .split('propertyPath: initialName')[1] ?.split('value: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); if (name === undefined) { name = prefabFile.rawText .split('initialName: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); } if (name === undefined) { @@ -105,14 +105,14 @@ const crawlPrefabs = (basePath) => { .split('propertyPath: m_Name')[1] ?.split('value: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); } // last resort if (name === undefined) { name = prefabFile.rawText .split('m_Name: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); } // initialName implement this instead of m_name diff --git a/i18n/FR/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/constructionLister.js b/i18n/FR/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/constructionLister.js index 0476e8da..68749f2b 100755 --- a/i18n/FR/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/constructionLister.js +++ b/i18n/FR/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/constructionLister.js @@ -60,7 +60,7 @@ const init = () => { .split('propertyPath: initialName')[1] ?.split('value: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); const spriteId = buildingMaterial.rawText .split('propertyPath: m_Sprite')[1] diff --git a/i18n/FR/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/textureCrawler.js b/i18n/FR/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/textureCrawler.js index 947205af..bf53b450 100755 --- a/i18n/FR/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/textureCrawler.js +++ b/i18n/FR/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/textureCrawler.js @@ -91,13 +91,13 @@ const crawlPrefabs = (basePath) => { .split('propertyPath: initialName')[1] ?.split('value: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); if (name === undefined) { name = prefabFile.rawText .split('initialName: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); } if (name === undefined) { @@ -105,14 +105,14 @@ const crawlPrefabs = (basePath) => { .split('propertyPath: m_Name')[1] ?.split('value: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); } // last resort if (name === undefined) { name = prefabFile.rawText .split('m_Name: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); } // initialName implement this instead of m_name diff --git a/i18n/RU/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/constructionLister.js b/i18n/RU/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/constructionLister.js index 0476e8da..68749f2b 100755 --- a/i18n/RU/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/constructionLister.js +++ b/i18n/RU/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/constructionLister.js @@ -60,7 +60,7 @@ const init = () => { .split('propertyPath: initialName')[1] ?.split('value: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); const spriteId = buildingMaterial.rawText .split('propertyPath: m_Sprite')[1] diff --git a/i18n/RU/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/textureCrawler.js b/i18n/RU/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/textureCrawler.js index 947205af..bf53b450 100755 --- a/i18n/RU/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/textureCrawler.js +++ b/i18n/RU/docusaurus-plugin-content-docs/current/4_Univers/tools/craftableLister/textureCrawler.js @@ -91,13 +91,13 @@ const crawlPrefabs = (basePath) => { .split('propertyPath: initialName')[1] ?.split('value: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); if (name === undefined) { name = prefabFile.rawText .split('initialName: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); } if (name === undefined) { @@ -105,14 +105,14 @@ const crawlPrefabs = (basePath) => { .split('propertyPath: m_Name')[1] ?.split('value: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); } // last resort if (name === undefined) { name = prefabFile.rawText .split('m_Name: ')[1] ?.split('\n')[0] - ?.replace('\r', ''); + ?.replaceAll('\r', ''); } // initialName implement this instead of m_name