Cheetah
get_file.php
Go to the documentation of this file.
1 <?php
2 
8 require_once("../../../inc/header.inc.php");
9 require_once($sIncPath . "customFunctions.inc.php");
10 
11 $bResult = false;
12 $sId = (int)$_GET["id"];
14 $sFile = "files/" . $sId . "." . (isset($_GET["ext"]) && preg_match('/^[0-9a-z]+$/', $_GET["ext"]) ? $_GET["ext"] : "mp3");
15 $sType = "audio/" . (isset($_GET["ext"]) && preg_match('/^[0-9a-z]+$/', $_GET["ext"]) ? $_GET["ext"] : "mpeg");
16 
17 if(!empty($sId) && !empty($sToken) && file_exists($sFile)) {
18  require_once($sIncPath . "db.inc.php");
19  $sId = getValue("SELECT `ID` FROM `RayMp3Tokens` WHERE `ID`='" . $sId . "' AND `Token`='" . $sToken . "' LIMIT 1");
20  $bResult = !empty($sId);
21 }
22 
23 if($bResult) {
24  require_once($sIncPath . "functions.inc.php");
26 } else
27  readfile($sFileErrorPath);
process_db_input
process_db_input($sText, $iStripTags=0)
Definition: utils.inc.php:256
$sToken
$sToken
Definition: get_file.php:13
$sIncPath
$sIncPath
Definition: header.inc.php:64
$sFile
$sFile
Definition: get_file.php:14
php
getValue
getValue($sQuery)
Definition: db.inc.php:59
$sType
$sType
Definition: get_file.php:15
$_GET
$_GET['debug']
Definition: index.php:67
$sFileErrorPath
$sFileErrorPath
Definition: header.inc.php:46
$bResult
$bResult
Definition: get_file.php:11
smartReadFile
smartReadFile($sPath, $sFilename='', $sMimeType='application/octet-stream', $iCacheAge=0, $sCachePrivacy='public')
Definition: functions.inc.php:301
$sId
$sId
Definition: get_file.php:12
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7