diff --git a/classes/URL.php b/classes/URL.php index f4c372e..25413c2 100644 --- a/classes/URL.php +++ b/classes/URL.php @@ -16,18 +16,17 @@ class URL } /** - * @param string $doNext - * @param $lineEnding - * @param $lineNumber + * @param string $lineEnding + * @param int $lineNumber * @return string */ - public function load($doNext = "", $lineEnding = "\n", $lineNumber = 1): string + public function load($lineEnding = "\n", $lineNumber = 1): string { // replace \r\n (Windows), \r (old Mac) and \n (Linux) line endings with whatever we chose to be lineEnding $this->remoteFile = str_replace("\r\n", $lineEnding, $this->remoteFile); $this->remoteFile = str_replace("\r", $lineEnding, $this->remoteFile); $this->remoteFile = str_replace("\n", $lineEnding, $this->remoteFile); - $doNext .= 'ICEcoder.newTab(false);'; + $doNext = 'ICEcoder.newTab(false);'; $doNext .= 'ICEcoder.getcMInstance().setValue(\'' . str_replace("\r", "", str_replace("\t", "\\\\t", str_replace("\n", "\\\\n", str_replace("'", "\\\\'", str_replace("\\", "\\\\", preg_quote($this->remoteFile)))))) . '\');'; $doNext .= 'ICEcoder.goToLine(' . $lineNumber . ');'; diff --git a/lib/file-control.php b/lib/file-control.php index 47ec795..489e1b5 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -411,7 +411,7 @@ if (!isset($ftpSite) && !$error && "getRemoteFile" === $_GET['action']) { if ($remoteFile = toUTF8noBOM(getData($file, 'curl'), true)) { // Get URL contents $url = new URL($remoteFile); - $doNext = $url->load($doNext, $ICEcoder["lineEnding"], $lineNumber); + $doNext .= $url->load($ICEcoder["lineEnding"], $lineNumber); $finalAction = "getRemoteFile"; // Run any extra processes