mirror of
https://github.com/phpbb/phpbb.git
synced 2025-03-14 04:30:29 +01:00
Merge pull request #2766 from marc1706/ticket/12560
[ticket/12560] Add methods to set upload and temp paths in plupload
This commit is contained in:
commit
4a6a54472c
@ -79,8 +79,7 @@ class plupload
|
||||
$this->php_ini = $php_ini;
|
||||
$this->mimetype_guesser = $mimetype_guesser;
|
||||
|
||||
$this->upload_directory = $this->phpbb_root_path . $this->config['upload_path'];
|
||||
$this->temporary_directory = $this->upload_directory . '/plupload';
|
||||
$this->set_default_directories();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -120,6 +119,9 @@ class plupload
|
||||
{
|
||||
rename("{$file_path}.part", $file_path);
|
||||
|
||||
// Reset upload directories to defaults once completed
|
||||
$this->set_default_directories();
|
||||
|
||||
// Need to modify some of the $_FILES values to reflect the new file
|
||||
return array(
|
||||
'tmp_name' => $file_path,
|
||||
@ -372,4 +374,29 @@ class plupload
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the default directories for uploads
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
protected function set_default_directories()
|
||||
{
|
||||
$this->upload_directory = $this->phpbb_root_path . $this->config['upload_path'];
|
||||
$this->temporary_directory = $this->upload_directory . '/plupload';
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the upload directories to the specified paths
|
||||
*
|
||||
* @param string $upload_directory Upload directory
|
||||
* @param string $temporary_directory Temporary directory
|
||||
*
|
||||
* @return null
|
||||
*/
|
||||
public function set_upload_directories($upload_directory, $temporary_directory)
|
||||
{
|
||||
$this->upload_directory = $upload_directory;
|
||||
$this->temporary_directory = $temporary_directory;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user