minor tweaks:

treat XML as editable file
use htmlentities to escape textarea content
This commit is contained in:
Andrey Grinenko
2015-02-20 23:49:54 +03:00
parent 9f408abb34
commit e1a1b1b1cf

View File

@@ -82,11 +82,11 @@ if ($_GET['action']=="load") {
if (array_search($fileExt,array("gif","jpg","jpeg","png"))!==false) {$finfo = "image";};
if (array_search($fileExt,array("doc","docx","ppt","rtf","pdf","zip","tar","gz","swf","asx","asf","midi","mp3","wav","aiff","mov","qt","wmv","mp4","odt","odg","odp"))!==false) {$finfo = "other";};
}
if (strpos($finfo,"text")===0 || strpos($finfo,"empty")!==false) {
if (strpos($finfo,"text")===0 || strpos($finfo, "application/xml")===0 || strpos($finfo,"empty")!==false) {
echo 'fileType="text";';
echo 'top.ICEcoder.shortURL = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";';
$loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true);
echo '</script><textarea name="loadedFile" id="loadedFile">'.str_replace("</textarea>","<ICEcoder:/:textarea>",str_replace("&","&amp;",$loadedFile)).'</textarea><script>';
echo '</script><textarea name="loadedFile" id="loadedFile">'.htmlentities($loadedFile).'</textarea><script>';
// Run our custom processes
include_once("../processes/on-file-load.php");
} else if (strpos($finfo,"image")===0) {