From 3f5b8f5d9203aa7ffb7fbe9cdbaf9dba3da6cae6 Mon Sep 17 00:00:00 2001 From: Hybris95 <hybris_95@hotmail.com> Date: Thu, 01 May 2014 16:14:15 -0400 Subject: [PATCH] Fixes sort, page building and search functions on "my tickets" page. --- src/main/java/com/gitblit/FileSettings.java | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/src/main/java/com/gitblit/FileSettings.java b/src/main/java/com/gitblit/FileSettings.java index d31fc2f..21a2043 100644 --- a/src/main/java/com/gitblit/FileSettings.java +++ b/src/main/java/com/gitblit/FileSettings.java @@ -103,6 +103,23 @@ return properties; } + @Override + public boolean saveSettings() { + String content = FileUtils.readContent(propertiesFile, "\n"); + for (String key : removals) { + String regex = "(?m)^(" + regExEscape(key) + "\\s*+=\\s*+)" + + "(?:[^\r\n\\\\]++|\\\\(?:\r?\n|\r|.))*+$"; + content = content.replaceAll(regex, ""); + } + removals.clear(); + + FileUtils.writeContent(propertiesFile, content); + // manually set the forceReload flag because not all JVMs support real + // millisecond resolution of lastModified. (issue-55) + forceReload = true; + return true; + } + /** * Updates the specified settings in the settings file. */ -- Gitblit v1.9.1