Language: JavaScript
Label: safe
CWE: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Code:
Graph.customFontElements={};Graph.recentCustomFonts={};Graph.isGoogleFontUrl=function(g){return g.substring(0,Editor.GOOGLE_FONTS.length)==Editor.GOOGLE_FONTS};Graph.isCssFontUrl=function(g){return Graph.isGoogleFontUrl(g)};Graph.createFontElement=function(g,x){var F=Graph.fontMapping[x];null==F&&Graph.isCssFontUrl(x)?(g=document.createElement("link"),g.setAttribute("rel","stylesheet"),g.setAttribute("type","text/css"),g.setAttribute("charset","UTF-8"),g.setAttribute("href",x)):(null==F&&(F='@font-face {\nfont-family: "'+
g+'";\nsrc: url("'+x+'");\n}'),g=document.createElement("style"),mxUtils.write(g,F));return g};Graph.addFont=function(g,x,F){if(null!=g&&0<g.length&&null!=x&&0<x.length){var M=g.toLowerCase();if("helvetica"!=M&&"arial"!=g&&"sans-serif"!=M){var Q=Graph.customFontElements[M];null!=Q&&Q.url!=x&&(Q.elt.parentNode.removeChild(Q.elt),Q=null);null==Q?(Q=x,"http:"==x.substring(0,5)&&(Q=PROXY_URL+"?url="+encodeURIComponent(x)),Q={name:g,url:x,elt:Graph.createFontElement(g,Q)},Graph.customFontElements[M]=Q,