diff options
author | Marc Alexander <admin@m-a-styles.de> | 2015-06-02 15:29:32 +0200 |
---|---|---|
committer | Marc Alexander <admin@m-a-styles.de> | 2015-09-09 08:27:53 +0200 |
commit | 52652ca1824e91ecfe7549167aebd92c314af678 (patch) | |
tree | 56f629c9070e635fefa6e09fed95b0868dd7acd5 /phpBB/phpbb/files | |
parent | 47f8f2cc88bdcd40087c8e391be1d33d36a2d308 (diff) | |
download | forums-52652ca1824e91ecfe7549167aebd92c314af678.tar forums-52652ca1824e91ecfe7549167aebd92c314af678.tar.gz forums-52652ca1824e91ecfe7549167aebd92c314af678.tar.bz2 forums-52652ca1824e91ecfe7549167aebd92c314af678.tar.xz forums-52652ca1824e91ecfe7549167aebd92c314af678.zip |
[ticket/13904] Remove phpbb_root_path global from upload class
PHPBB3-13904
Diffstat (limited to 'phpBB/phpbb/files')
-rw-r--r-- | phpBB/phpbb/files/upload.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/phpBB/phpbb/files/upload.php b/phpBB/phpbb/files/upload.php index e62c29883a..38aad5a3bd 100644 --- a/phpBB/phpbb/files/upload.php +++ b/phpBB/phpbb/files/upload.php @@ -63,6 +63,9 @@ class upload /** @var \phpbb\request\request_interface Request class */ protected $request; + /** @var string phpBB root path */ + protected $phpbb_root_path; + /** * Init file upload class. * @@ -70,13 +73,15 @@ class upload * @param \phpbb\files\factory $factory Files factory * @param \phpbb\language\language $language Language class * @param \phpbb\request\request_interface $request Request class + * @param string $phpbb_root_path phpBB root path */ - public function __construct(filesystem_interface $filesystem, factory $factory, language $language, request_interface $request) + public function __construct(filesystem_interface $filesystem, factory $factory, language $language, request_interface $request, $phpbb_root_path) { $this->filesystem = $filesystem; $this->factory = $factory; $this->language = $language; $this->request = $request; + $this->phpbb_root_path = $phpbb_root_path; } /** @@ -350,8 +355,6 @@ class upload */ function remote_upload($upload_url) { - global $phpbb_root_path; - $upload_ary = array(); $upload_ary['local_mode'] = true; @@ -504,7 +507,7 @@ class upload return $this->factory->get('filespec')->set_error($this->error_prefix . 'EMPTY_REMOTE_DATA'); } - $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $phpbb_root_path . 'cache'; + $tmp_path = (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') ? false : $this->phpbb_root_path . 'cache'; $filename = tempnam($tmp_path, unique_id() . '-'); if (!($fp = @fopen($filename, 'wb'))) |