mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-02-20 01:51:18 +01:00
18 lines
551 B
PHP
18 lines
551 B
PHP
<?php
|
|
require "icecoder.php";
|
|
|
|
use ICEcoder\File;
|
|
|
|
// Establish the real absolute path to the file
|
|
$filePath = realpath($docRoot . $iceRoot . str_replace("|", "/", $_GET['file']));
|
|
// If it doesn't exist, or doesn't start with the $docRoot, stop here
|
|
if (false === file_exists($filePath) || 0 !== strpos(str_replace("\\", "/", $filePath), $docRoot)) {
|
|
die("<script>ICEcoder.message('Sorry, that file doesn\'t appear to exist');</script>");
|
|
}
|
|
|
|
if (true === file_exists($filePath)) {
|
|
$file = new File();
|
|
$file->download($filePath);
|
|
exit;
|
|
}
|