* finish task #7307.

This commit is contained in:
z
2020-07-06 15:00:10 +08:00
parent 984d130d00
commit 945eb9ac25
+4 -2
View File
@@ -205,13 +205,15 @@ class fileModel extends model
$file['title'] = $purifier->purify($file['title']);
$file['size'] = $_POST['size'];
$file['tmpname'] = $tmp_name;
/* Fix for build uuid like '../../'. */
$file['uuid'] = str_replace(array('.', '/', '\\'), '', $_POST['uuid']);
$file['uuid'] = $_POST['uuid'];
$file['pathname'] = $this->setPathName(0, $file['extension']);
$file['chunkpath'] = 'chunks' . DS .'f_' . $file['uuid'] . '.' . $file['extension'] . '.part';
$file['chunks'] = isset($_POST['chunks']) ? intval($_POST['chunks']) : 0;
$file['chunk'] = isset($_POST['chunk']) ? intval($_POST['chunk']) : 0;
/* Fix for build uuid like '../../'. */
if(!preg_match('/[a-z0-9_]/i', $file['uuid'])) return false;
if(stripos($this->config->file->allowed, ',' . $file['extension'] . ',') === false)
{
$file['pathname'] = $file['pathname'] . '.notAllowed';