aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-08-14 09:03:55 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-09-09 08:27:37 +0200
commit1af6f052d80e693d289258d490c1187a064093b9 (patch)
treebe5a6a5e7ced33777f582e57a2211df32d6af60f /phpBB/phpbb/files
parent[ticket/13904] Add fileupload class to files classes (diff)
downloadphpbb-1af6f052d80e693d289258d490c1187a064093b9.tar.gz
phpbb-1af6f052d80e693d289258d490c1187a064093b9.tar.bz2
phpbb-1af6f052d80e693d289258d490c1187a064093b9.zip
[ticket/13904] Load upload class using factory
PHPBB3-13904
Diffstat (limited to 'phpBB/phpbb/files')
-rw-r--r--phpBB/phpbb/files/upload.php31
1 files changed, 16 insertions, 15 deletions
diff --git a/phpBB/phpbb/files/upload.php b/phpBB/phpbb/files/upload.php
index 7501247e06..8666b857a5 100644
--- a/phpBB/phpbb/files/upload.php
+++ b/phpBB/phpbb/files/upload.php
@@ -40,24 +40,15 @@ class upload
* Init file upload class.
*
* @param \phpbb\filesystem\filesystem_interface $filesystem
- * @param string $error_prefix Used error messages will get prefixed by this string
- * @param array $allowed_extensions Array of allowed extensions, for example array('jpg', 'jpeg', 'gif', 'png')
- * @param int $max_filesize Maximum filesize
- * @param int $min_width Minimum image width (only checked for images)
- * @param int $min_height Minimum image height (only checked for images)
- * @param int $max_width Maximum image width (only checked for images)
- * @param int $max_height Maximum image height (only checked for images)
- * @param bool|array $disallowed_content If enabled, the first 256 bytes of the file must not
- * contain any of its values. Defaults to false.
*
*/
- function fileupload(\phpbb\filesystem\filesystem_interface $filesystem, $error_prefix = '', $allowed_extensions = false, $max_filesize = false, $min_width = false, $min_height = false, $max_width = false, $max_height = false, $disallowed_content = false)
+ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem)
{
- $this->set_allowed_extensions($allowed_extensions);
- $this->set_max_filesize($max_filesize);
- $this->set_allowed_dimensions($min_width, $min_height, $max_width, $max_height);
- $this->set_error_prefix($error_prefix);
- $this->set_disallowed_content($disallowed_content);
+// $this->set_allowed_extensions($allowed_extensions);
+// $this->set_max_filesize($max_filesize);
+// $this->set_allowed_dimensions($min_width, $min_height, $max_width, $max_height);
+// $this->set_error_prefix($error_prefix);
+// $this->set_disallowed_content($disallowed_content);
$this->filesystem = $filesystem;
}
@@ -82,6 +73,8 @@ class upload
{
$this->allowed_extensions = $allowed_extensions;
}
+
+ return $this;
}
/**
@@ -93,6 +86,8 @@ class upload
$this->min_height = (int) $min_height;
$this->max_width = (int) $max_width;
$this->max_height = (int) $max_height;
+
+ return $this;
}
/**
@@ -104,6 +99,8 @@ class upload
{
$this->max_filesize = (int) $max_filesize;
}
+
+ return $this;
}
/**
@@ -115,6 +112,8 @@ class upload
{
$this->disallowed_content = array_diff($disallowed_content, array(''));
}
+
+ return $this;
}
/**
@@ -123,6 +122,8 @@ class upload
function set_error_prefix($error_prefix)
{
$this->error_prefix = $error_prefix;
+
+ return $this;
}
/**