From d781f539c92b96090f1e56466d69f70065145300 Mon Sep 17 00:00:00 2001 From: "hitalo.siriano" Date: Tue, 22 Oct 2024 19:20:28 -0300 Subject: [PATCH 1/2] Fix: Replace pipe character (|) with %7C in URLs Modified the handling of URLs in the file field to replace the pipe character (|) with its encoded representation (%7C) to avoid exceptions in JabRef. Closes #123 --- .../java/org/jabref/logic/importer/util/FileFieldParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java b/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java index 695c0a48cbe..4aaf6ffa15e 100644 --- a/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java +++ b/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java @@ -25,7 +25,8 @@ public FileFieldParser(String value) { if (value == null) { this.value = null; } else { - this.value = value.replace("$\\backslash$", "\\"); + String valueFormat = value.replace("|", "%7C"); + this.value = valueFormat.replace("$\\backslash$", "\\"); } } From dc8de3279a87155cd50b4b3c838d436b5cad14bf Mon Sep 17 00:00:00 2001 From: "hitalo.siriano" Date: Tue, 22 Oct 2024 19:20:28 -0300 Subject: [PATCH 2/2] Fix: Replace pipe character (|) with %7C in URLs Modified the handling of URLs in the file field to replace the pipe character (|) with its encoded representation (%7C) to avoid exceptions in JabRef. Closes #11876 --- .../java/org/jabref/logic/importer/util/FileFieldParser.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java b/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java index 695c0a48cbe..4aaf6ffa15e 100644 --- a/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java +++ b/src/main/java/org/jabref/logic/importer/util/FileFieldParser.java @@ -25,7 +25,8 @@ public FileFieldParser(String value) { if (value == null) { this.value = null; } else { - this.value = value.replace("$\\backslash$", "\\"); + String valueFormat = value.replace("|", "%7C"); + this.value = valueFormat.replace("$\\backslash$", "\\"); } }