[ Index ]

PHP Cross Reference of phpBB-3.3.0-deutsch

title

Body

[close]

/phpbb/files/ -> upload.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 390 lines (10 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

upload:: (15 methods):
  __construct()
  reset_vars()
  set_allowed_extensions()
  set_allowed_dimensions()
  set_max_filesize()
  set_disallowed_content()
  set_error_prefix()
  handle_upload()
  assign_internal_error()
  common_checks()
  valid_extension()
  valid_dimensions()
  is_valid()
  valid_content()
  image_types()


Class: upload  - X-Ref

File upload class
Init class (all parameters optional and able to be set/overwritten separately) - scope is global and valid for all uploads

__construct(filesystem_interface $filesystem, factory $factory, language $language, \bantu\IniGetWrapper\IniGetWrapper $php_ini, request_interface $request)   X-Ref
Init file upload class.

param: filesystem_interface $filesystem
param: factory $factory Files factory
param: language $language Language class
param: \bantu\IniGetWrapper\IniGetWrapper $php_ini ini_get() wrapper
param: request_interface $request Request class

reset_vars()   X-Ref
Reset vars


set_allowed_extensions($allowed_extensions)   X-Ref
Set allowed extensions

return: \phpbb\files\upload This instance of upload
param: array $allowed_extensions Allowed file extensions

set_allowed_dimensions($min_width, $min_height, $max_width, $max_height)   X-Ref
Set allowed dimensions

return: \phpbb\files\upload This instance of upload
param: int $min_width Minimum image width
param: int $min_height Minimum image height
param: int $max_width Maximum image width
param: int $max_height Maximum image height

set_max_filesize($max_filesize)   X-Ref
Set maximum allowed file size

return: \phpbb\files\upload This instance of upload
param: int $max_filesize Maximum file size

set_disallowed_content($disallowed_content)   X-Ref
Set disallowed strings

return: \phpbb\files\upload This instance of upload
param: array $disallowed_content Disallowed content

set_error_prefix($error_prefix)   X-Ref
Set error prefix

return: \phpbb\files\upload This instance of upload
param: string $error_prefix Prefix for language variables of errors

handle_upload($type)   X-Ref
Handle upload based on type

return: \phpbb\files\filespec|bool A filespec instance if upload was
param: string $type Upload type

assign_internal_error($errorcode)   X-Ref
Assign internal error

return: string Error string
param: string $errorcode Error code to assign

common_checks($file)   X-Ref
Perform common file checks

param: filespec $file Instance of filespec class

valid_extension($file)   X-Ref
Check for allowed extension

return: bool True if extension is allowed, false if not
param: filespec $file Instance of filespec class

valid_dimensions($file)   X-Ref
Check for allowed dimension

return: bool True if dimensions are valid or no constraints set, false
param: filespec $file Instance of filespec class

is_valid($form_name)   X-Ref
Check if form upload is valid

return: bool True if form upload is valid, false if not
param: string $form_name Name of form

valid_content($file)   X-Ref
Check for bad content (IE mime-sniffing)

return: bool True if content is valid, false if not
param: filespec $file Instance of filespec class

image_types()   X-Ref
Get image type/extension mapping

return: array Array containing the image types and their extensions



Generated: Tue Apr 7 19:44:41 2020 Cross-referenced by PHPXref 0.7.1