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:
function(c){var e=E.apply(this,arguments);this.addListener("darkModeChanged",mxUtils.bind(this,function(){e.refresh();this.restoreOpenLibraries()}));this.addListener("sketchModeChanged",mxUtils.bind(this,function(){e.refresh();this.restoreOpenLibraries()}));return e};EditorUi.prototype.restoreOpenLibraries=function(){var c=this.openLibraries;this.openLibraries=null;if(null!=c)for(var e=0;e<c.length;e++)this.libraryLoaded(c[e].file,c[e].images,c[e].title,null!=c[e].div?"none"!=c[e].div.style.display:
c[e].expand)};var U=EditorUi.prototype.updateActionStates;EditorUi.prototype.updateActionStates=function(){U.apply(this,arguments);var c=this.editor.graph,e=this.getCurrentFile(),k=this.getSelectionState(),n=this.isDiagramActive(),p="1"==urlParams.embed&&this.editor.graph.isEnabled()||null!=e&&e.isEditable();this.actions.get("undo").setEnabled(this.canUndo()&&p);this.actions.get("redo").setEnabled(this.canRedo()&&p);this.actions.get("autosave").setEnabled(null!=e&&e.isEditable()&&e.isAutosaveOptional());