$auth = false; } $pathWithName = $_GET['saveto'] . PATH_SPLITTER . basename(urldecode($_GET['filename'])); while (strpos($pathWithName, "\\\\") !== false) { $pathWithName = str_replace("\\\\", "\\", $pathWithName); } if (strpos($pathWithName, '?') !== false) { $pathWithName = substr($pathWithName, 0, strpos($pathWithName, '?')); } echo "<script type='text/javascript'>updateStatus({$i}, '" . lang(26) . "');</script>{$nn}"; $url = parse_url($_GET['link']); if (empty($url['port'])) { $url['port'] = $_GET['port']; } if (isset($url['scheme']) && $url['scheme'] == 'ftp' && empty($_GET['proxy'])) { $file = getftpurl($_GET['host'], defport($url), urldecode($_GET['path']), $pathWithName); } else { !empty($_GET['force_name']) ? $force_name = urldecode($_GET['force_name']) : ''; $file = geturl($_GET['host'], defport($url), $_GET['path'], $_GET['referer'], $_GET['cookie'], $_GET['post'], $pathWithName, $_GET['proxy'], $pauth, $auth, $url['scheme']); } if ($options['redir'] && $lastError && strpos($lastError, substr(lang(95), 0, strpos(lang(95), '%1$s'))) !== false) { $redirectto = trim(cut_str($lastError, substr(lang(95), 0, strpos(lang(95), '%1$s')), ']')); $_GET['referer'] = urlencode($_GET['link']); if (strpos($redirectto, '://') === false) { // If redirect doesn't have the host $ref = parse_url(urldecode($_GET['referer'])); unset($ref['user'], $ref['pass'], $ref['query'], $ref['fragment']); if (substr($redirectto, 0, 1) != '/') { $redirectto = "/{$redirectto}"; } $purl = array_merge($ref, parse_url($redirectto));
$AUTH["use"] = TRUE; $AUTH["str"] = $_GET["auth"]; } else { unset($AUTH); } $ftp = parse_url($_GET["link"]); $IS_FTP = $ftp["scheme"] == "ftp" ? TRUE : FALSE; $AUTH["ftp"] = array("login" => $ftp["user"] ? $ftp["user"] : "******", "password" => $ftp["pass"] ? $ftp["pass"] : "******"); $pathWithName = $_GET["saveto"] . PATH_SPLITTER . $_GET["filename"]; while (stristr($pathWithName, "\\\\")) { $pathWithName = str_replace("\\\\", "\\", $pathWithName); } list($pathWithName, $tmp) = explode('?', $pathWithName); echo '<script type="text/javascript">updateStatus(' . $i . ", '" . lang(26) . "');</script>" . $nn; if ($ftp["scheme"] == "ftp" && !$_GET["proxy"]) { $file = getftpurl($_GET["host"], $ftp["port"] ? $ftp["port"] : 21, $_GET["path"], $pathWithName); } else { $_GET["force_name"] ? $force_name = urldecode($_GET["force_name"]) : ''; $file = geturl($_GET["host"], $_GET["port"], $_GET["path"], $_GET["referer"], $_GET["cookie"], $_GET["post"], $pathWithName, $_GET["proxy"], $pauth, $auth, $ftp["scheme"]); } if ($redir && $lastError && stristr($lastError, "Error! it is redirected to [")) { $redirectto = trim(cut_str($lastError, "Error! it is redirected to [", "]")); $_GET["link"] = $redirectto; $purl = parse_url($redirectto); list($_GET["filename"], $tmp) = explode('?', basename($redirectto)); $_GET["host"] = $purl["host"]; $_GET["path"] = $purl["path"] . ($purl["query"] ? "?" . $purl["query"] : ""); $lastError = ""; } if ($lastError) { echo '<script type="text/javascript">updateStatus(' . $i . ", '" . $lastError . "');</script>" . $nn;