gc(); $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path']; if (!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path'])) { $path = $_GET['path']; }else { die(TXT_FILE_NOT_FOUND); } if (file_exists(DIR_AJAX_EDIT_AREA . "reg_syntax" . DIRECTORY_SEPARATOR . getFileExt($path) . ".js")) { $syntax = getFileExt($path); }else { switch (getFileExt($path)) { case 'htm': $syntax = 'html'; break; default: $syntax = 'basic'; } } if (array_search(getFileExt($path), getValidTextEditorExts())=== false) { die(TXT_DISALLOWED_EXT); } ?>