1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

Movet get_download out of the website root, as it is not supported

to access this directly. Download mirror selections are supported
via the /get/$filename/from/a/mirror URLs
This commit is contained in:
Gabor Hojtsy
2003-08-09 16:43:45 +00:00
parent e8155641bc
commit eb015354f1
2 changed files with 9 additions and 9 deletions

View File

@@ -104,7 +104,7 @@ if (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", $URI, $dlinfo)) {
// Mirror selection page
if ($dlinfo[2] == "a") {
include_once $_SERVER['DOCUMENT_ROOT'] . "/get_download.php";
include_once $_SERVER['DOCUMENT_ROOT'] . "/include/get-download.inc";
exit;
}
@@ -115,7 +115,7 @@ if (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", $URI, $dlinfo)) {
else { $mr = "http://{$dlinfo[2]}/"; }
// Start the download process
include "do-download.inc";
include $_SERVER['DOCUMENT_ROOT'] . "/include/do-download.inc";
download_file($mr, $df);
exit;
}

View File

@@ -1,17 +1,17 @@
<?php
include_once 'prepend.inc';
include_once 'mirrortable.inc';
// $Id$
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/mirrortable.inc';
// Try to make this page non-cached
header_nocache();
// If there is no such file, then drop out an invalid file error message
if (!isset($df) || !file_exists($DOCUMENT_ROOT . '/distributions/' . $df)) {
if (!isset($df) || !file_exists($_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $df)) {
exit('Invalid file requested for download!');
}
// Set local file name
$local_file = $DOCUMENT_ROOT . '/distributions/' . $df;
$local_file = $_SERVER['DOCUMENT_ROOT'] . '/distributions/' . $df;
// Print out common header
commonHeader('Get Download');
@@ -20,14 +20,14 @@ commonHeader('Get Download');
<h1>Choose mirror site for download</h1>
<p>
You have chosen to download the following file:
You have chosen to download the following file:
</p>
<div align="center">
<div class="center">
<table border="0" cellpadding="10" cellspacing="1" width="500">
<tr bgcolor="#cccccc"><td align="center">
<?php
echo '<b>' . $df . '</b><br />';
echo '<strong>' . $df . '</strong><br />';
// Try to get filesize to display
$size = @filesize($local_file);