aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_upload.php
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2012-12-24 14:34:10 +0100
committerMarc Alexander <admin@m-a-styles.de>2012-12-24 14:34:10 +0100
commitc9338b38b35675bd1d620e4a8ca7d44a522faace (patch)
tree0746db7f0eb5f22780c04e3ece5fb6a549045860 /phpBB/includes/functions_upload.php
parente6aaef6066549696453063417167e5a79c53b353 (diff)
parent46b3c3ecc43721e53c9711a196e91c300e03a1c8 (diff)
downloadforums-c9338b38b35675bd1d620e4a8ca7d44a522faace.tar
forums-c9338b38b35675bd1d620e4a8ca7d44a522faace.tar.gz
forums-c9338b38b35675bd1d620e4a8ca7d44a522faace.tar.bz2
forums-c9338b38b35675bd1d620e4a8ca7d44a522faace.tar.xz
forums-c9338b38b35675bd1d620e4a8ca7d44a522faace.zip
Merge branch 'develop' of github.com:marc1706/phpbb3 into feature/avatars
Diffstat (limited to 'phpBB/includes/functions_upload.php')
-rw-r--r--phpBB/includes/functions_upload.php15
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'),