1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-22 04:55:10 +00:00

Replace URL with SURL to securely access URLs

This commit is contained in:
Dietrich Travkin 2023-07-04 10:42:38 +02:00
parent d92242ec35
commit 0972786515

View File

@ -49,6 +49,7 @@ import net.sourceforge.plantuml.regex.RegexConcat;
import net.sourceforge.plantuml.regex.RegexLeaf;
import net.sourceforge.plantuml.regex.RegexResult;
import net.sourceforge.plantuml.security.SFile;
import net.sourceforge.plantuml.security.SURL;
import net.sourceforge.plantuml.style.parser.StyleParser;
import net.sourceforge.plantuml.style.parser.StyleParsingException;
import net.sourceforge.plantuml.utils.BlocLines;
@ -84,7 +85,7 @@ public class CommandStyleImport extends SingleLineCommand2<TitledDiagram> {
try {
BlocLines lines = null;
if (path.startsWith("http")) {
URL url = new URL(path);
SURL url = SURL.create (path);
try (InputStream remoteInputStream = url.openStream()) {
lines = BlocLines.load(remoteInputStream, location);
}