summaryrefslogtreecommitdiff
path: root/plugins/code-modernization/hooks/register.ts
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/code-modernization/hooks/register.ts')
-rw-r--r--plugins/code-modernization/hooks/register.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/plugins/code-modernization/hooks/register.ts b/plugins/code-modernization/hooks/register.ts
index 212144de..e74abe71 100644
--- a/plugins/code-modernization/hooks/register.ts
+++ b/plugins/code-modernization/hooks/register.ts
@@ -394,6 +394,11 @@ export function register(on: On, raw: PluginOptions) {
const legacyRoot = join(state.options.legacyDir, snapshot.system)
const written = norm(citation.path)
+
+ // A citation comes from a file in the analysis tree: it names a file inside the code, never a way out of it.
+ if (written.startsWith('/') || /^[A-Za-z]:/.test(written) || written.split('/').includes('..')) {
+ return
+ }
const viaMap = snapshot.topology !== null ? nodeOfFile(snapshot.topology, written)?.file : undefined
const candidates = [