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

Code:
    var openInline = function(editor){
        status = !status;
        var $main = $(editor.editorContainer);
        var form  = editor.formCode;
        if(!form){
            var $to = $main.find('.tox-sidebar-wrap');
            var data = {
                formStyle:{"className":"form-box-title-block toc-form-code-editor"},
                code:{type:'codeEditor'}
            };
            $('<div class="toc-editor-source hidden"></div>').appendTo($to);
            form = new kodApi.formMaker({formData:data});
            form.renderTarget($main.find('.toc-editor-source'));
            $main.find('.form-target-save').hide();
            
            form.bind('onSave',function(data){
                setContent(editor,data.code);
            });
            editor.formCode = form;
        }
        var $area = $main.find('.toc-editor-source');
        var $btn  = $main.find('.tox-tbtn.toolbar-codeView');
        if(status){
            $btn.addClass('tox-tbtn--enabled');
            $area.removeClass('hidden');
            $main.find('.tox-tbtn,.tox-mbtn,.tox-split-button').not($btn).addClass('tox-btn-disable');
        }else{
            $btn.removeClass('tox-tbtn--enabled');
            $area.addClass('hidden');
            $main.find('.tox-tbtn,.tox-mbtn,.tox-split-button').removeClass('tox-btn-disable');
        }
        
        var html = editor.getContent({source_view:true});
        if(status){
            form.setValue('code',html);
            var aceEditor = $main.find(".ace_editor").data('editor');
            if(aceEditor){
                // aceEditor.execCommand('phpBeautify');
            }
        }else{
            var theData = form.getValue();
            if(theData.code){
                setContent(editor,theData.code);
            }
        }
        editor.formCode = form;
    }