Fix recursive replacement in NetworkPageExporter

A replacer could replace same String multiple times and produce
../../../../server/ instead of intended ../server/

Changed method call from replace to replaceOnce
A single instance of server/ exists in the file.

Affected issues:
- Possibly fixed #1195
This commit is contained in:
Rsl1122 2019-10-19 13:07:07 +03:00
parent d07c83e111
commit e41b270f1b

View File

@ -188,7 +188,7 @@ public class NetworkPageExporter extends FileExporter {
export(to, theme.replaceThemeColors(resource.asString()));
} else if ("js/network-values.js".equalsIgnoreCase(resourceName)) {
// Replace /server in urls to fix server page links
export(to, StringUtils.replace(resource.asString(), "server/", toRelativePathFromRoot("server") + '/'));
export(to, StringUtils.replaceOnce(resource.asString(), "server/", toRelativePathFromRoot("server") + '/'));
} else {
export(to, resource.asLines());
}