Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/wp-file-.../lib/php
File: elFinderVolumeDriver.class.php
*/
[3500] Fix | Delete
public function getUploadTaget($baseTargetHash, $path, & $result)
[3501] Fix | Delete
{
[3502] Fix | Delete
$base = $this->decode($baseTargetHash);
[3503] Fix | Delete
$targetHash = $baseTargetHash;
[3504] Fix | Delete
$path = ltrim($path, $this->separator);
[3505] Fix | Delete
$dirs = explode($this->separator, $path);
[3506] Fix | Delete
array_pop($dirs);
[3507] Fix | Delete
foreach ($dirs as $dir) {
[3508] Fix | Delete
$targetPath = $this->joinPathCE($base, $dir);
[3509] Fix | Delete
if (!$_realpath = $this->realpath($this->encode($targetPath))) {
[3510] Fix | Delete
if ($stat = $this->mkdir($targetHash, $dir)) {
[3511] Fix | Delete
$result['added'][] = $stat;
[3512] Fix | Delete
$targetHash = $stat['hash'];
[3513] Fix | Delete
$base = $this->decode($targetHash);
[3514] Fix | Delete
} else {
[3515] Fix | Delete
return false;
[3516] Fix | Delete
}
[3517] Fix | Delete
} else {
[3518] Fix | Delete
$targetHash = $this->encode($_realpath);
[3519] Fix | Delete
if ($this->dir($targetHash)) {
[3520] Fix | Delete
$base = $this->decode($targetHash);
[3521] Fix | Delete
} else {
[3522] Fix | Delete
return false;
[3523] Fix | Delete
}
[3524] Fix | Delete
}
[3525] Fix | Delete
}
[3526] Fix | Delete
return $targetHash;
[3527] Fix | Delete
}
[3528] Fix | Delete
[3529] Fix | Delete
/**
[3530] Fix | Delete
* Return this uploadMaxSize value
[3531] Fix | Delete
*
[3532] Fix | Delete
* @return integer
[3533] Fix | Delete
* @author Naoki Sawada
[3534] Fix | Delete
*/
[3535] Fix | Delete
public function getUploadMaxSize()
[3536] Fix | Delete
{
[3537] Fix | Delete
return $this->uploadMaxSize;
[3538] Fix | Delete
}
[3539] Fix | Delete
[3540] Fix | Delete
public function setUploadOverwrite($var)
[3541] Fix | Delete
{
[3542] Fix | Delete
$this->uploadOverwrite = (bool)$var;
[3543] Fix | Delete
}
[3544] Fix | Delete
[3545] Fix | Delete
/**
[3546] Fix | Delete
* Image file utility
[3547] Fix | Delete
*
[3548] Fix | Delete
* @param string $mode 'resize', 'rotate', 'propresize', 'crop', 'fitsquare'
[3549] Fix | Delete
* @param string $src Image file local path
[3550] Fix | Delete
* @param array $options excute options
[3551] Fix | Delete
*
[3552] Fix | Delete
* @return bool
[3553] Fix | Delete
* @throws ImagickException
[3554] Fix | Delete
* @throws elFinderAbortException
[3555] Fix | Delete
* @author Naoki Sawada
[3556] Fix | Delete
*/
[3557] Fix | Delete
public function imageUtil($mode, $src, $options = array())
[3558] Fix | Delete
{
[3559] Fix | Delete
if (!isset($options['jpgQuality'])) {
[3560] Fix | Delete
$options['jpgQuality'] = intval($this->options['jpgQuality']);
[3561] Fix | Delete
}
[3562] Fix | Delete
if (!isset($options['bgcolor'])) {
[3563] Fix | Delete
$options['bgcolor'] = '#ffffff';
[3564] Fix | Delete
}
[3565] Fix | Delete
if (!isset($options['bgColorFb'])) {
[3566] Fix | Delete
$options['bgColorFb'] = $this->options['bgColorFb'];
[3567] Fix | Delete
}
[3568] Fix | Delete
$destformat = !empty($options['destformat'])? $options['destformat'] : null;
[3569] Fix | Delete
[3570] Fix | Delete
// check 'width' ,'height'
[3571] Fix | Delete
if (in_array($mode, array('resize', 'propresize', 'crop', 'fitsquare'))) {
[3572] Fix | Delete
if (empty($options['width']) || empty($options['height'])) {
[3573] Fix | Delete
return false;
[3574] Fix | Delete
}
[3575] Fix | Delete
}
[3576] Fix | Delete
[3577] Fix | Delete
if (!empty($options['checkAnimated'])) {
[3578] Fix | Delete
if ($this->imgLib !== 'imagick' && $this->imgLib !== 'convert') {
[3579] Fix | Delete
if (elFinder::isAnimationGif($src)) {
[3580] Fix | Delete
return false;
[3581] Fix | Delete
}
[3582] Fix | Delete
}
[3583] Fix | Delete
if (elFinder::isAnimationPng($src)) {
[3584] Fix | Delete
return false;
[3585] Fix | Delete
}
[3586] Fix | Delete
}
[3587] Fix | Delete
[3588] Fix | Delete
switch ($mode) {
[3589] Fix | Delete
case 'rotate':
[3590] Fix | Delete
if (empty($options['degree'])) {
[3591] Fix | Delete
return true;
[3592] Fix | Delete
}
[3593] Fix | Delete
return (bool)$this->imgRotate($src, $options['degree'], $options['bgColorFb'], $destformat, $options['jpgQuality']);
[3594] Fix | Delete
[3595] Fix | Delete
case 'resize':
[3596] Fix | Delete
return (bool)$this->imgResize($src, $options['width'], $options['height'], false, true, $destformat, $options['jpgQuality'], $options);
[3597] Fix | Delete
[3598] Fix | Delete
case 'propresize':
[3599] Fix | Delete
return (bool)$this->imgResize($src, $options['width'], $options['height'], true, true, $destformat, $options['jpgQuality'], $options);
[3600] Fix | Delete
[3601] Fix | Delete
case 'crop':
[3602] Fix | Delete
if (isset($options['x']) && isset($options['y'])) {
[3603] Fix | Delete
return (bool)$this->imgCrop($src, $options['width'], $options['height'], $options['x'], $options['y'], $destformat, $options['jpgQuality']);
[3604] Fix | Delete
}
[3605] Fix | Delete
break;
[3606] Fix | Delete
[3607] Fix | Delete
case 'fitsquare':
[3608] Fix | Delete
return (bool)$this->imgSquareFit($src, $options['width'], $options['height'], 'center', 'middle', $options['bgcolor'], $destformat, $options['jpgQuality']);
[3609] Fix | Delete
[3610] Fix | Delete
}
[3611] Fix | Delete
return false;
[3612] Fix | Delete
}
[3613] Fix | Delete
[3614] Fix | Delete
/**
[3615] Fix | Delete
* Convert Video To Image by ffmpeg
[3616] Fix | Delete
*
[3617] Fix | Delete
* @param string $file video source file path
[3618] Fix | Delete
* @param array $stat file stat array
[3619] Fix | Delete
* @param object $self volume driver object
[3620] Fix | Delete
* @param int $ss start seconds
[3621] Fix | Delete
*
[3622] Fix | Delete
* @return bool
[3623] Fix | Delete
* @throws elFinderAbortException
[3624] Fix | Delete
* @author Naoki Sawada
[3625] Fix | Delete
*/
[3626] Fix | Delete
public function ffmpegToImg($file, $stat, $self, $ss = null)
[3627] Fix | Delete
{
[3628] Fix | Delete
$name = basename($file);
[3629] Fix | Delete
$path = dirname($file);
[3630] Fix | Delete
$tmp = $path . DIRECTORY_SEPARATOR . md5($name);
[3631] Fix | Delete
// register auto delete on shutdown
[3632] Fix | Delete
$GLOBALS['elFinderTempFiles'][$tmp] = true;
[3633] Fix | Delete
if (rename($file, $tmp)) {
[3634] Fix | Delete
if ($ss === null) {
[3635] Fix | Delete
// specific start time by file name (xxx^[sec].[extention] - video^3.mp4)
[3636] Fix | Delete
if (preg_match('/\^(\d+(?:\.\d+)?)\.[^.]+$/', $stat['name'], $_m)) {
[3637] Fix | Delete
$ss = $_m[1];
[3638] Fix | Delete
} else {
[3639] Fix | Delete
$ss = $this->options['tmbVideoConvSec'];
[3640] Fix | Delete
}
[3641] Fix | Delete
}
[3642] Fix | Delete
$cmd = sprintf(ELFINDER_FFMPEG_PATH . ' -i %s -ss 00:00:%.3f -vframes 1 -f image2 -- %s', escapeshellarg($tmp), $ss, escapeshellarg($file));
[3643] Fix | Delete
$r = ($this->procExec($cmd) === 0);
[3644] Fix | Delete
clearstatcache();
[3645] Fix | Delete
if ($r && $ss > 0 && !file_exists($file)) {
[3646] Fix | Delete
// Retry by half of $ss
[3647] Fix | Delete
$ss = max(intval($ss / 2), 0);
[3648] Fix | Delete
rename($tmp, $file);
[3649] Fix | Delete
$r = $this->ffmpegToImg($file, $stat, $self, $ss);
[3650] Fix | Delete
} else {
[3651] Fix | Delete
unlink($tmp);
[3652] Fix | Delete
}
[3653] Fix | Delete
return $r;
[3654] Fix | Delete
}
[3655] Fix | Delete
return false;
[3656] Fix | Delete
}
[3657] Fix | Delete
[3658] Fix | Delete
/**
[3659] Fix | Delete
* Creates a temporary file and return file pointer
[3660] Fix | Delete
*
[3661] Fix | Delete
* @return resource|boolean
[3662] Fix | Delete
*/
[3663] Fix | Delete
public function tmpfile()
[3664] Fix | Delete
{
[3665] Fix | Delete
if ($tmp = $this->getTempFile()) {
[3666] Fix | Delete
return fopen($tmp, 'wb');
[3667] Fix | Delete
}
[3668] Fix | Delete
return false;
[3669] Fix | Delete
}
[3670] Fix | Delete
[3671] Fix | Delete
/**
[3672] Fix | Delete
* Save error message
[3673] Fix | Delete
*
[3674] Fix | Delete
* @param array error
[3675] Fix | Delete
*
[3676] Fix | Delete
* @return boolean false
[3677] Fix | Delete
* @author Naoki Sawada
[3678] Fix | Delete
**/
[3679] Fix | Delete
protected function setError()
[3680] Fix | Delete
{
[3681] Fix | Delete
$this->error = array();
[3682] Fix | Delete
$this->addError(func_get_args());
[3683] Fix | Delete
return false;
[3684] Fix | Delete
}
[3685] Fix | Delete
[3686] Fix | Delete
/**
[3687] Fix | Delete
* Add error message
[3688] Fix | Delete
*
[3689] Fix | Delete
* @param array error
[3690] Fix | Delete
*
[3691] Fix | Delete
* @return false
[3692] Fix | Delete
* @author Dmitry(dio) Levashov
[3693] Fix | Delete
**/
[3694] Fix | Delete
protected function addError()
[3695] Fix | Delete
{
[3696] Fix | Delete
foreach (func_get_args() as $err) {
[3697] Fix | Delete
if (is_array($err)) {
[3698] Fix | Delete
foreach($err as $er) {
[3699] Fix | Delete
$this->addError($er);
[3700] Fix | Delete
}
[3701] Fix | Delete
} else {
[3702] Fix | Delete
$this->error[] = (string)$err;
[3703] Fix | Delete
}
[3704] Fix | Delete
}
[3705] Fix | Delete
return false;
[3706] Fix | Delete
}
[3707] Fix | Delete
[3708] Fix | Delete
/*********************************************************************/
[3709] Fix | Delete
/* FS API */
[3710] Fix | Delete
/*********************************************************************/
[3711] Fix | Delete
[3712] Fix | Delete
/***************** server encoding support *******************/
[3713] Fix | Delete
[3714] Fix | Delete
/**
[3715] Fix | Delete
* Return parent directory path (with convert encoding)
[3716] Fix | Delete
*
[3717] Fix | Delete
* @param string $path file path
[3718] Fix | Delete
*
[3719] Fix | Delete
* @return string
[3720] Fix | Delete
* @author Naoki Sawada
[3721] Fix | Delete
**/
[3722] Fix | Delete
protected function dirnameCE($path)
[3723] Fix | Delete
{
[3724] Fix | Delete
$dirname = (!$this->encoding) ? $this->_dirname($path) : $this->convEncOut($this->_dirname($this->convEncIn($path)));
[3725] Fix | Delete
// check to infinite loop prevention
[3726] Fix | Delete
return ($dirname != $path) ? $dirname : '';
[3727] Fix | Delete
}
[3728] Fix | Delete
[3729] Fix | Delete
/**
[3730] Fix | Delete
* Return file name (with convert encoding)
[3731] Fix | Delete
*
[3732] Fix | Delete
* @param string $path file path
[3733] Fix | Delete
*
[3734] Fix | Delete
* @return string
[3735] Fix | Delete
* @author Naoki Sawada
[3736] Fix | Delete
**/
[3737] Fix | Delete
protected function basenameCE($path)
[3738] Fix | Delete
{
[3739] Fix | Delete
return (!$this->encoding) ? $this->_basename($path) : $this->convEncOut($this->_basename($this->convEncIn($path)));
[3740] Fix | Delete
}
[3741] Fix | Delete
[3742] Fix | Delete
/**
[3743] Fix | Delete
* Join dir name and file name and return full path. (with convert encoding)
[3744] Fix | Delete
* Some drivers (db) use int as path - so we give to concat path to driver itself
[3745] Fix | Delete
*
[3746] Fix | Delete
* @param string $dir dir path
[3747] Fix | Delete
* @param string $name file name
[3748] Fix | Delete
*
[3749] Fix | Delete
* @return string
[3750] Fix | Delete
* @author Naoki Sawada
[3751] Fix | Delete
**/
[3752] Fix | Delete
protected function joinPathCE($dir, $name)
[3753] Fix | Delete
{
[3754] Fix | Delete
return (!$this->encoding) ? $this->_joinPath($dir, $name) : $this->convEncOut($this->_joinPath($this->convEncIn($dir), $this->convEncIn($name)));
[3755] Fix | Delete
}
[3756] Fix | Delete
[3757] Fix | Delete
/**
[3758] Fix | Delete
* Return normalized path (with convert encoding)
[3759] Fix | Delete
*
[3760] Fix | Delete
* @param string $path file path
[3761] Fix | Delete
*
[3762] Fix | Delete
* @return string
[3763] Fix | Delete
* @author Naoki Sawada
[3764] Fix | Delete
**/
[3765] Fix | Delete
protected function normpathCE($path)
[3766] Fix | Delete
{
[3767] Fix | Delete
return (!$this->encoding) ? $this->_normpath($path) : $this->convEncOut($this->_normpath($this->convEncIn($path)));
[3768] Fix | Delete
}
[3769] Fix | Delete
[3770] Fix | Delete
/**
[3771] Fix | Delete
* Return file path related to root dir (with convert encoding)
[3772] Fix | Delete
*
[3773] Fix | Delete
* @param string $path file path
[3774] Fix | Delete
*
[3775] Fix | Delete
* @return string
[3776] Fix | Delete
* @author Naoki Sawada
[3777] Fix | Delete
**/
[3778] Fix | Delete
protected function relpathCE($path)
[3779] Fix | Delete
{
[3780] Fix | Delete
return (!$this->encoding) ? $this->_relpath($path) : $this->convEncOut($this->_relpath($this->convEncIn($path)));
[3781] Fix | Delete
}
[3782] Fix | Delete
[3783] Fix | Delete
/**
[3784] Fix | Delete
* Convert path related to root dir into real path (with convert encoding)
[3785] Fix | Delete
*
[3786] Fix | Delete
* @param string $path rel file path
[3787] Fix | Delete
*
[3788] Fix | Delete
* @return string
[3789] Fix | Delete
* @author Naoki Sawada
[3790] Fix | Delete
**/
[3791] Fix | Delete
protected function abspathCE($path)
[3792] Fix | Delete
{
[3793] Fix | Delete
return (!$this->encoding) ? $this->_abspath($path) : $this->convEncOut($this->_abspath($this->convEncIn($path)));
[3794] Fix | Delete
}
[3795] Fix | Delete
[3796] Fix | Delete
/**
[3797] Fix | Delete
* Return true if $path is children of $parent (with convert encoding)
[3798] Fix | Delete
*
[3799] Fix | Delete
* @param string $path path to check
[3800] Fix | Delete
* @param string $parent parent path
[3801] Fix | Delete
*
[3802] Fix | Delete
* @return bool
[3803] Fix | Delete
* @author Naoki Sawada
[3804] Fix | Delete
**/
[3805] Fix | Delete
protected function inpathCE($path, $parent)
[3806] Fix | Delete
{
[3807] Fix | Delete
return (!$this->encoding) ? $this->_inpath($path, $parent) : $this->convEncOut($this->_inpath($this->convEncIn($path), $this->convEncIn($parent)));
[3808] Fix | Delete
}
[3809] Fix | Delete
[3810] Fix | Delete
/**
[3811] Fix | Delete
* Open file and return file pointer (with convert encoding)
[3812] Fix | Delete
*
[3813] Fix | Delete
* @param string $path file path
[3814] Fix | Delete
* @param string $mode
[3815] Fix | Delete
*
[3816] Fix | Delete
* @return false|resource
[3817] Fix | Delete
* @internal param bool $write open file for writing
[3818] Fix | Delete
* @author Naoki Sawada
[3819] Fix | Delete
*/
[3820] Fix | Delete
protected function fopenCE($path, $mode = 'rb')
[3821] Fix | Delete
{
[3822] Fix | Delete
// check extra option for network stream pointer
[3823] Fix | Delete
if (func_num_args() > 2) {
[3824] Fix | Delete
$opts = func_get_arg(2);
[3825] Fix | Delete
} else {
[3826] Fix | Delete
$opts = array();
[3827] Fix | Delete
}
[3828] Fix | Delete
return (!$this->encoding) ? $this->_fopen($path, $mode, $opts) : $this->convEncOut($this->_fopen($this->convEncIn($path), $mode, $opts));
[3829] Fix | Delete
}
[3830] Fix | Delete
[3831] Fix | Delete
/**
[3832] Fix | Delete
* Close opened file (with convert encoding)
[3833] Fix | Delete
*
[3834] Fix | Delete
* @param resource $fp file pointer
[3835] Fix | Delete
* @param string $path file path
[3836] Fix | Delete
*
[3837] Fix | Delete
* @return bool
[3838] Fix | Delete
* @author Naoki Sawada
[3839] Fix | Delete
**/
[3840] Fix | Delete
protected function fcloseCE($fp, $path = '')
[3841] Fix | Delete
{
[3842] Fix | Delete
return (!$this->encoding) ? $this->_fclose($fp, $path) : $this->convEncOut($this->_fclose($fp, $this->convEncIn($path)));
[3843] Fix | Delete
}
[3844] Fix | Delete
[3845] Fix | Delete
/**
[3846] Fix | Delete
* Create new file and write into it from file pointer. (with convert encoding)
[3847] Fix | Delete
* Return new file path or false on error.
[3848] Fix | Delete
*
[3849] Fix | Delete
* @param resource $fp file pointer
[3850] Fix | Delete
* @param string $dir target dir path
[3851] Fix | Delete
* @param string $name file name
[3852] Fix | Delete
* @param array $stat file stat (required by some virtual fs)
[3853] Fix | Delete
*
[3854] Fix | Delete
* @return bool|string
[3855] Fix | Delete
* @author Naoki Sawada
[3856] Fix | Delete
**/
[3857] Fix | Delete
protected function saveCE($fp, $dir, $name, $stat)
[3858] Fix | Delete
{
[3859] Fix | Delete
$res = (!$this->encoding) ? $this->_save($fp, $dir, $name, $stat) : $this->convEncOut($this->_save($fp, $this->convEncIn($dir), $this->convEncIn($name), $this->convEncIn($stat)));
[3860] Fix | Delete
if ($res !== false) {
[3861] Fix | Delete
$this->clearstatcache();
[3862] Fix | Delete
}
[3863] Fix | Delete
return $res;
[3864] Fix | Delete
}
[3865] Fix | Delete
[3866] Fix | Delete
/**
[3867] Fix | Delete
* Return true if path is dir and has at least one childs directory (with convert encoding)
[3868] Fix | Delete
*
[3869] Fix | Delete
* @param string $path dir path
[3870] Fix | Delete
*
[3871] Fix | Delete
* @return bool
[3872] Fix | Delete
* @author Naoki Sawada
[3873] Fix | Delete
**/
[3874] Fix | Delete
protected function subdirsCE($path)
[3875] Fix | Delete
{
[3876] Fix | Delete
if ($this->sessionCaching['subdirs']) {
[3877] Fix | Delete
if (isset($this->sessionCache['subdirs'][$path]) && !$this->isMyReload()) {
[3878] Fix | Delete
return $this->sessionCache['subdirs'][$path];
[3879] Fix | Delete
}
[3880] Fix | Delete
}
[3881] Fix | Delete
$hasdir = (bool)((!$this->encoding) ? $this->_subdirs($path) : $this->convEncOut($this->_subdirs($this->convEncIn($path))));
[3882] Fix | Delete
$this->updateSubdirsCache($path, $hasdir);
[3883] Fix | Delete
return $hasdir;
[3884] Fix | Delete
}
[3885] Fix | Delete
[3886] Fix | Delete
/**
[3887] Fix | Delete
* Return files list in directory (with convert encoding)
[3888] Fix | Delete
*
[3889] Fix | Delete
* @param string $path dir path
[3890] Fix | Delete
*
[3891] Fix | Delete
* @return array
[3892] Fix | Delete
* @author Naoki Sawada
[3893] Fix | Delete
**/
[3894] Fix | Delete
protected function scandirCE($path)
[3895] Fix | Delete
{
[3896] Fix | Delete
return (!$this->encoding) ? $this->_scandir($path) : $this->convEncOut($this->_scandir($this->convEncIn($path)));
[3897] Fix | Delete
}
[3898] Fix | Delete
[3899] Fix | Delete
/**
[3900] Fix | Delete
* Create symlink (with convert encoding)
[3901] Fix | Delete
*
[3902] Fix | Delete
* @param string $source file to link to
[3903] Fix | Delete
* @param string $targetDir folder to create link in
[3904] Fix | Delete
* @param string $name symlink name
[3905] Fix | Delete
*
[3906] Fix | Delete
* @return bool
[3907] Fix | Delete
* @author Naoki Sawada
[3908] Fix | Delete
**/
[3909] Fix | Delete
protected function symlinkCE($source, $targetDir, $name)
[3910] Fix | Delete
{
[3911] Fix | Delete
return (!$this->encoding) ? $this->_symlink($source, $targetDir, $name) : $this->convEncOut($this->_symlink($this->convEncIn($source), $this->convEncIn($targetDir), $this->convEncIn($name)));
[3912] Fix | Delete
}
[3913] Fix | Delete
[3914] Fix | Delete
/***************** paths *******************/
[3915] Fix | Delete
[3916] Fix | Delete
/**
[3917] Fix | Delete
* Encode path into hash
[3918] Fix | Delete
*
[3919] Fix | Delete
* @param string file path
[3920] Fix | Delete
*
[3921] Fix | Delete
* @return string
[3922] Fix | Delete
* @author Dmitry (dio) Levashov
[3923] Fix | Delete
* @author Troex Nevelin
[3924] Fix | Delete
**/
[3925] Fix | Delete
protected function encode($path)
[3926] Fix | Delete
{
[3927] Fix | Delete
if ($path !== '') {
[3928] Fix | Delete
[3929] Fix | Delete
// cut ROOT from $path for security reason, even if hacker decodes the path he will not know the root
[3930] Fix | Delete
$p = $this->relpathCE($path);
[3931] Fix | Delete
// if reqesting root dir $path will be empty, then assign '/' as we cannot leave it blank for crypt
[3932] Fix | Delete
if ($p === '') {
[3933] Fix | Delete
$p = $this->separator;
[3934] Fix | Delete
}
[3935] Fix | Delete
// change separator
[3936] Fix | Delete
if ($this->separatorForHash) {
[3937] Fix | Delete
$p = str_replace($this->separator, $this->separatorForHash, $p);
[3938] Fix | Delete
}
[3939] Fix | Delete
// TODO crypt path and return hash
[3940] Fix | Delete
$hash = $this->crypt($p);
[3941] Fix | Delete
// hash is used as id in HTML that means it must contain vaild chars
[3942] Fix | Delete
// make base64 html safe and append prefix in begining
[3943] Fix | Delete
$hash = strtr(base64_encode($hash), '+/=', '-_.');
[3944] Fix | Delete
// remove dots '.' at the end, before it was '=' in base64
[3945] Fix | Delete
$hash = rtrim($hash, '.');
[3946] Fix | Delete
// append volume id to make hash unique
[3947] Fix | Delete
return $this->id . $hash;
[3948] Fix | Delete
}
[3949] Fix | Delete
//TODO: Add return statement here
[3950] Fix | Delete
}
[3951] Fix | Delete
[3952] Fix | Delete
/**
[3953] Fix | Delete
* Decode path from hash
[3954] Fix | Delete
*
[3955] Fix | Delete
* @param string file hash
[3956] Fix | Delete
*
[3957] Fix | Delete
* @return string
[3958] Fix | Delete
* @author Dmitry (dio) Levashov
[3959] Fix | Delete
* @author Troex Nevelin
[3960] Fix | Delete
**/
[3961] Fix | Delete
protected function decode($hash)
[3962] Fix | Delete
{
[3963] Fix | Delete
if (strpos($hash, $this->id) === 0) {
[3964] Fix | Delete
// cut volume id after it was prepended in encode
[3965] Fix | Delete
$h = substr($hash, strlen($this->id));
[3966] Fix | Delete
// replace HTML safe base64 to normal
[3967] Fix | Delete
$h = base64_decode(strtr($h, '-_.', '+/='));
[3968] Fix | Delete
// TODO uncrypt hash and return path
[3969] Fix | Delete
$path = $this->uncrypt($h);
[3970] Fix | Delete
// change separator
[3971] Fix | Delete
if ($this->separatorForHash) {
[3972] Fix | Delete
$path = str_replace($this->separatorForHash, $this->separator, $path);
[3973] Fix | Delete
}
[3974] Fix | Delete
// append ROOT to path after it was cut in encode
[3975] Fix | Delete
return $this->abspathCE($path);//$this->root.($path === $this->separator ? '' : $this->separator.$path);
[3976] Fix | Delete
}
[3977] Fix | Delete
return '';
[3978] Fix | Delete
}
[3979] Fix | Delete
[3980] Fix | Delete
/**
[3981] Fix | Delete
* Return crypted path
[3982] Fix | Delete
* Not implemented
[3983] Fix | Delete
*
[3984] Fix | Delete
* @param string path
[3985] Fix | Delete
*
[3986] Fix | Delete
* @return mixed
[3987] Fix | Delete
* @author Dmitry (dio) Levashov
[3988] Fix | Delete
**/
[3989] Fix | Delete
protected function crypt($path)
[3990] Fix | Delete
{
[3991] Fix | Delete
return $path;
[3992] Fix | Delete
}
[3993] Fix | Delete
[3994] Fix | Delete
/**
[3995] Fix | Delete
* Return uncrypted path
[3996] Fix | Delete
* Not implemented
[3997] Fix | Delete
*
[3998] Fix | Delete
* @param mixed hash
[3999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function