aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-06-02 15:46:41 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-09-09 08:27:54 +0200
commitb871dbcf1f2d0483cbe19cddf94a5bdc9659ab00 (patch)
tree67f2e480c3540db9d3c6b3d48d2db3872a6f6408 /phpBB/phpbb/files
parent[ticket/13904] Remove phpbb_root_path global from upload class (diff)
downloadphpbb-b871dbcf1f2d0483cbe19cddf94a5bdc9659ab00.tar.gz
phpbb-b871dbcf1f2d0483cbe19cddf94a5bdc9659ab00.tar.bz2
phpbb-b871dbcf1f2d0483cbe19cddf94a5bdc9659ab00.zip
[ticket/13904] Remove phpbb_root_path global from filespec class
PHPBB3-13904
Diffstat (limited to 'phpBB/phpbb/files')
-rw-r--r--phpBB/phpbb/files/filespec.php19
1 files changed, 11 insertions, 8 deletions
diff --git a/phpBB/phpbb/files/filespec.php b/phpBB/phpbb/files/filespec.php
index 5e685615d7..736610f6c2 100644
--- a/phpBB/phpbb/files/filespec.php
+++ b/phpBB/phpbb/files/filespec.php
@@ -86,20 +86,25 @@ class filespec
/** @var \phpbb\language\language Language class */
protected $language;
+ /** @var string phpBB root path */
+ protected $phpbb_root_path;
+
/**
* File upload class
*
- * @param \phpbb\filesystem\filesystem_interface $phpbb_filesystem
- * @param \phpbb\language\language $language
- * @param \phpbb\mimetype\guesser $mimetype_guesser
- * @param \phpbb\plupload\plupload $plupload
+ * @param \phpbb\filesystem\filesystem_interface $phpbb_filesystem Filesystem
+ * @param \phpbb\language\language $language Language
+ * @param string $phpbb_root_path phpBB root path
+ * @param \phpbb\mimetype\guesser $mimetype_guesser Mime type guesser
+ * @param \phpbb\plupload\plupload $plupload Plupload
*/
- function __construct(\phpbb\filesystem\filesystem_interface $phpbb_filesystem, language $language, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
+ function __construct(\phpbb\filesystem\filesystem_interface $phpbb_filesystem, language $language, $phpbb_root_path, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{
$this->plupload = $plupload;
$this->mimetype_guesser = $mimetype_guesser;
$this->filesystem = $phpbb_filesystem;
$this->language = $language;
+ $this->phpbb_root_path = $phpbb_root_path;
}
/**
@@ -390,8 +395,6 @@ class filespec
*/
function move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = false)
{
- global $phpbb_root_path;
-
if (sizeof($this->error))
{
return false;
@@ -400,7 +403,7 @@ class filespec
$chmod = ($chmod === false) ? CHMOD_READ | CHMOD_WRITE : $chmod;
// We need to trust the admin in specifying valid upload directories and an attacker not being able to overwrite it...
- $this->destination_path = $phpbb_root_path . $destination;
+ $this->destination_path = $this->phpbb_root_path . $destination;
// Check if the destination path exist...
if (!file_exists($this->destination_path))