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:
Editor.selectFilename=function(a){var b=a.value.lastIndexOf(".");if(0<b){var e=a.value.substring(b+1);"drawio"!=e&&0<=mxUtils.indexOf(["png","svg","html","xml","pdf"],e)&&(e=a.value.lastIndexOf(".drawio.",b),0<e&&(b=e))}b=0<b?b:a.value.length;Editor.selectSubstring(a,0,b)};