diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-18 04:11:56 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-12-18 04:11:56 -0500 |
commit | 3af5531d0d8df7ed734e688780407014ff1840f8 (patch) | |
tree | 635d2dcd8e9c96357d52ca27e8d827910bf7919b /phpBB/includes/functions_upload.php | |
parent | da2f0757d777e3b7d34ac65884400ce276d99c9a (diff) | |
parent | 4ae0c787828ea34bb927a8346804e52bd25cffac (diff) | |
download | forums-3af5531d0d8df7ed734e688780407014ff1840f8.tar forums-3af5531d0d8df7ed734e688780407014ff1840f8.tar.gz forums-3af5531d0d8df7ed734e688780407014ff1840f8.tar.bz2 forums-3af5531d0d8df7ed734e688780407014ff1840f8.tar.xz forums-3af5531d0d8df7ed734e688780407014ff1840f8.zip |
Merge PR #1147 branch 'marc1706/ticket/10763' into develop
* marc1706/ticket/10763:
[ticket/10763] Use self when calling get_extension() in filespec class
[ticket/10763] Make functions for remote avatars static
Diffstat (limited to 'phpBB/includes/functions_upload.php')
-rw-r--r-- | phpBB/includes/functions_upload.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index b467aa93d1..4f31a85e83 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -70,7 +70,7 @@ class filespec $this->mimetype = 'application/octetstream'; } - $this->extension = strtolower($this->get_extension($this->realname)); + $this->extension = strtolower(self::get_extension($this->realname)); // Try to get real filesize from temporary folder (not always working) ;) $this->filesize = (@filesize($this->filename)) ? @filesize($this->filename) : $this->filesize; @@ -187,8 +187,11 @@ class filespec /** * Get file extension + * + * @param string Filename that needs to be checked + * @return string Extension of the supplied filename */ - function get_extension($filename) + static public function get_extension($filename) { if (strpos($filename, '.') === false) { @@ -369,7 +372,7 @@ class filespec } // Check image type - $types = $this->upload->image_types(); + $types = fileupload::image_types(); if (!isset($types[$this->image_info[2]]) || !in_array($this->extension, $types[$this->image_info[2]])) { @@ -1019,9 +1022,11 @@ class fileupload } /** - * Return image type/extension mapping + * Get image type/extension mapping + * + * @return array Array containing the image types and their extensions */ - function image_types() + static public function image_types() { return array( IMAGETYPE_GIF => array('gif'), |