diff --git a/core/src/main/java/org/jenkins/ui/symbol/Symbol.java b/core/src/main/java/org/jenkins/ui/symbol/Symbol.java index 9973acc18da5..9a07556d7c71 100644 --- a/core/src/main/java/org/jenkins/ui/symbol/Symbol.java +++ b/core/src/main/java/org/jenkins/ui/symbol/Symbol.java @@ -8,13 +8,30 @@ import hudson.Util; import java.io.IOException; import java.io.InputStream; +import java.io.StringWriter; import java.nio.charset.StandardCharsets; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; import jenkins.model.Jenkins; import org.apache.commons.io.IOUtils; +import org.apache.tools.ant.filters.StringInputStream; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; /** * Helper class to load symbols from Jenkins core or plugins. @@ -88,12 +105,37 @@ private static String loadSymbol(String namespace, String name) { LOGGER.log(Level.FINE, "Failed to load symbol " + name, e); } } - return markup.replaceAll("().*?()", "$1$2") - .replaceAll(" "The given src for the svg is not a valid xml document"); + return PLACEHOLDER_SVG; + } + + return markup; } @CheckForNull diff --git a/war/src/main/resources/images/symbols/journal.svg b/war/src/main/resources/images/symbols/journal.svg index 7bd396468079..26170aed452d 100644 --- a/war/src/main/resources/images/symbols/journal.svg +++ b/war/src/main/resources/images/symbols/journal.svg @@ -1 +1 @@ -ionicons-v5-o \ No newline at end of file +ionicons-v5-o \ No newline at end of file diff --git a/war/src/main/resources/images/symbols/lock-closed.svg b/war/src/main/resources/images/symbols/lock-closed.svg index 96a5e417f4ae..2e0cdde7c7c0 100644 --- a/war/src/main/resources/images/symbols/lock-closed.svg +++ b/war/src/main/resources/images/symbols/lock-closed.svg @@ -1 +1 @@ -ionicons-v5-g \ No newline at end of file +ionicons-v5-g \ No newline at end of file diff --git a/war/src/main/resources/images/symbols/play.svg b/war/src/main/resources/images/symbols/play.svg index a9bb95b897a9..ffc227bf89e2 100644 --- a/war/src/main/resources/images/symbols/play.svg +++ b/war/src/main/resources/images/symbols/play.svg @@ -1 +1 @@ -ionicons-v5-c \ No newline at end of file +ionicons-v5-c \ No newline at end of file diff --git a/war/src/main/resources/images/symbols/power.svg b/war/src/main/resources/images/symbols/power.svg index cc2d4d57b63c..92886b46a09a 100644 --- a/war/src/main/resources/images/symbols/power.svg +++ b/war/src/main/resources/images/symbols/power.svg @@ -1 +1 @@ -ionicons-v5-p \ No newline at end of file +ionicons-v5-p \ No newline at end of file diff --git a/war/src/main/resources/images/symbols/trash-bin.svg b/war/src/main/resources/images/symbols/trash-bin.svg index d8449544a7a8..572cb143609f 100644 --- a/war/src/main/resources/images/symbols/trash-bin.svg +++ b/war/src/main/resources/images/symbols/trash-bin.svg @@ -1 +1 @@ -ionicons-v5-k \ No newline at end of file +ionicons-v5-k \ No newline at end of file