"); }; } // 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); // Check this file isn't on the banned list at all $canOpen = true; for ($i=0;$i'); 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(getData($file),true); } $encoding=ini_get("default_charset"); if($encoding=="") { $encoding="UTF-8"; } // Get content and set HTML entities on it according to encoding $loadedFile = htmlentities($loadedFile,ENT_COMPAT,$encoding); // Remove \r chars and replace \n with carriage return HTML entity char $loadedFile = preg_replace('/\\r/','',$loadedFile); $loadedFile = preg_replace('/\\n/',' ',$loadedFile); echo '