"); }; } // If we're due to open a file... if ($_GET['action']=="load") { echo 'action="load";'; $lineNumber = max(isset($_REQUEST['lineNumber'])?intval($_REQUEST['lineNumber']):1, 1); if (isset($ftpSite) || file_exists($file)) { $finfo = "text"; // Determine what to do based on mime type if (!isset($ftpSite) && function_exists('finfo_open')) { $finfoMIME = finfo_open(FILEINFO_MIME); $finfo = finfo_file($finfoMIME, $file); finfo_close($finfoMIME); } else { $fileExt = explode(" ",pathinfo($file, PATHINFO_EXTENSION)); $fileExt = $fileExt[0]; 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, "application/xml")===0 || strpos($finfo,"empty")!==false) { echo 'fileType="text";'; echo 'top.ICEcoder.shortURL = top.ICEcoder.thisFileFolderLink = "'.$fileLoc."/".$fileName.'";'; // Get file over FTP? if (isset($ftpSite)) { ftpStart(); // Show user warning if no good connection if (!$ftpConn || !$ftpLogin) { die('alert("Sorry, no FTP connection to '.$ftpHost.' for user '.$ftpUser.'");top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);'); exit; } // Get our file contents and close the FTP connection $loadedFile = toUTF8noBOM(ftpGetContents($ftpConn, $ftpRoot.$fileLoc."/".$fileName, $ftpMode)); ftpEnd(); // Get local file } else { $loadedFile = toUTF8noBOM(file_get_contents($file,false,$context),true); } $encoding=ini_get("default_charset"); if($encoding=="") $encoding="UTF-8"; echo '