From 5e9eacc5cbd51c4dc3b1ea8a9d5734ad591c49fb Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 17 Jul 2024 17:43:23 +0200 Subject: [PATCH] fix xml tag matching * use correct regex for vertical whitespace splitting * only match tag start + tag name --- .../org/cryptomator/linux/quickaccess/DolphinPlaces.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/cryptomator/linux/quickaccess/DolphinPlaces.java b/src/main/java/org/cryptomator/linux/quickaccess/DolphinPlaces.java index 508b917..462f638 100644 --- a/src/main/java/org/cryptomator/linux/quickaccess/DolphinPlaces.java +++ b/src/main/java/org/cryptomator/linux/quickaccess/DolphinPlaces.java @@ -76,7 +76,7 @@ public QuickAccessService.QuickAccessEntry add(Path target, String displayName) //validate xmlValidator.validate(new StreamSource(new StringReader(placesContent))); // modify - int insertIndex = placesContent.lastIndexOf(""); //cannot be -1 due to validation + int insertIndex = placesContent.lastIndexOf("", idIndex); - var part2Tmp = placesContent.substring(closingTagIndex + "".length()).split("\\v*", 2); //removing leading vertical whitespaces - var contentToWrite2 = part2Tmp.length == 1 ? part2Tmp[0] : part2Tmp[1]; + int closingTagEndIndex = placesContent.indexOf('>', placesContent.indexOf("