cvs: phpweb / get_download.php
| From: | Gabor Hojtsy | Date: | Tue, 04 Feb 2003 14:05:49 +0000 |
| Subject: | cvs: phpweb / get_download.php | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-15485@lists.php.net to get a copy of this message | ||
goba Tue Feb 4 09:05:49 2003 EDT
Modified files:
/phpweb get_download.php
Log:
There is no such download file link containing a slash, so we don't
need that check, and the file size check should also use abdolute path,
so it works, even when included from some other script (error/index.php)
Index: phpweb/get_download.php
diff -u phpweb/get_download.php:1.7 phpweb/get_download.php:1.8
--- phpweb/get_download.php:1.7 Mon Feb 3 15:44:19 2003
+++ phpweb/get_download.php Tue Feb 4 09:05:48 2003
@@ -10,6 +10,9 @@
exit('Invalid file requested for download!');
}
+// Set local file name
+$local_file = $DOCUMENT_ROOT . '/distributions/' . $df;
+
// Print out common header
commonHeader('Get Download');
?>
@@ -25,13 +28,6 @@
<tr bgcolor="#cccccc"><td align="center">
<?php
echo '<b>' . $df . '</b><br />';
-
-// Get real file name
-if ($tmp = strrchr($df, '/')) {
- $local_file = substr($tmp, 1, strlen($tmp));
-} else {
- $local_file = 'distributions/' . $df;
-}
// Try to get filesize to display
$size = @filesize($local_file);