diff options
author | Dhruv <dhruv.goel92@gmail.com> | 2014-07-22 22:44:22 +0530 |
---|---|---|
committer | Dhruv <dhruv.goel92@gmail.com> | 2014-07-22 22:44:22 +0530 |
commit | 25c646cbf9eb2f2f300a03e4481cc99ee5767914 (patch) | |
tree | 12174bc984d8f540f9f638bf57992ff35d4fd0b5 | |
parent | cf88a6453c9ce08071854763c8000505fb6678e3 (diff) | |
parent | 4a6a54472c8854eaad71cdd4544403989d0e68af (diff) | |
download | forums-25c646cbf9eb2f2f300a03e4481cc99ee5767914.tar forums-25c646cbf9eb2f2f300a03e4481cc99ee5767914.tar.gz forums-25c646cbf9eb2f2f300a03e4481cc99ee5767914.tar.bz2 forums-25c646cbf9eb2f2f300a03e4481cc99ee5767914.tar.xz forums-25c646cbf9eb2f2f300a03e4481cc99ee5767914.zip |
Merge branch 'develop-ascraeus' into develop
# By Marc Alexander
# Via Dhruv Goel (1) and Marc Alexander (1)
* develop-ascraeus:
[ticket/12560] Add methods to set upload and temp paths in plupload
-rw-r--r-- | phpBB/phpbb/plupload/plupload.php | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php index c610d49a63..3c686a552f 100644 --- a/phpBB/phpbb/plupload/plupload.php +++ b/phpBB/phpbb/plupload/plupload.php @@ -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; + } } |