CC-2534: When copy files into storage folder it says wrong path name
filter all functions via realpath which will make directories consistent
This commit is contained in:
parent
6972150b19
commit
1411987b01
|
@ -561,7 +561,7 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
$api_key = $request->getParam('api_key');
|
||||
$path = base64_decode($request->getParam('path'));
|
||||
$path = realpath(base64_decode($request->getParam('path')))."/";
|
||||
|
||||
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
||||
{
|
||||
|
@ -578,7 +578,7 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
$api_key = $request->getParam('api_key');
|
||||
$path = base64_decode($request->getParam('path'));
|
||||
$path = realpath(base64_decode($request->getParam('path')))."/";
|
||||
|
||||
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
||||
{
|
||||
|
@ -595,7 +595,7 @@ class ApiController extends Zend_Controller_Action
|
|||
|
||||
$request = $this->getRequest();
|
||||
$api_key = $request->getParam('api_key');
|
||||
$path = base64_decode($request->getParam('path'));
|
||||
$path = realpath(base64_decode($request->getParam('path')))."/";
|
||||
|
||||
if (!in_array($api_key, $CC_CONFIG["apiKey"]))
|
||||
{
|
||||
|
|
|
@ -157,15 +157,13 @@ class MusicDir {
|
|||
public static function splitFilePath($p_filepath)
|
||||
{
|
||||
$mus_dir = self::getWatchedDirFromFilepath($p_filepath);
|
||||
|
||||
if(is_null($mus_dir)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$length_dir = strlen($mus_dir->getDirectory());
|
||||
$length_filepath = strlen($p_filepath);
|
||||
$length = $length_filepath - $length_dir;
|
||||
|
||||
$fp = substr($p_filepath, $length_dir+1, $length);
|
||||
$fp = substr($p_filepath, $length_dir);
|
||||
|
||||
return array($mus_dir->getDirectory(), $fp);
|
||||
}
|
||||
|
|
|
@ -417,7 +417,7 @@ class StoredFile {
|
|||
$music_dir = MusicDir::getDirByPK($this->_file->getDbDirectory());
|
||||
$filepath = $this->_file->getDbFilepath();
|
||||
|
||||
return $music_dir->getDirectory()."/".$filepath;
|
||||
return $music_dir->getDirectory().$filepath;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -53,7 +53,7 @@ if (AirtimeInstall::$databaseTablesCreated) {
|
|||
|
||||
$ini = parse_ini_file(__DIR__."/airtime-install.ini");
|
||||
|
||||
$stor_dir = $ini["storage_dir"];
|
||||
$stor_dir = realpath($ini["storage_dir"])."/";
|
||||
echo "* Inserting stor directory location $stor_dir into music_dirs table".PHP_EOL;
|
||||
|
||||
$sql = "INSERT INTO cc_music_dirs (directory, type) VALUES ('$stor_dir', 'stor')";
|
||||
|
|
|
@ -1 +1 @@
|
|||
storage_dir = /srv/airtime/stor
|
||||
storage_dir = /srv/airtime/stor/
|
||||
|
|
Loading…
Reference in New Issue