diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2005-11-19 16:16:52 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2005-11-19 16:16:52 +0000 |
commit | 318e561cb2a2698aed9fc2fff34e648deebb0676 (patch) | |
tree | c4dd2699911c16682a37c21f9cbcdeb7a68724a3 /phpBB/includes/functions_upload.php | |
parent | 68e80ad2df4b119c4528f200640ba507259d2bdb (diff) | |
download | forums-318e561cb2a2698aed9fc2fff34e648deebb0676.tar forums-318e561cb2a2698aed9fc2fff34e648deebb0676.tar.gz forums-318e561cb2a2698aed9fc2fff34e648deebb0676.tar.bz2 forums-318e561cb2a2698aed9fc2fff34e648deebb0676.tar.xz forums-318e561cb2a2698aed9fc2fff34e648deebb0676.zip |
- use acl_m_ instead of acl_m
- some reference fixes
git-svn-id: file:///svn/phpbb/trunk@5307 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_upload.php')
-rw-r--r-- | phpBB/includes/functions_upload.php | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 56fb295d59..a3109c0ef4 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -62,7 +62,7 @@ class filespec $this->mimetype = 'application/octetstream'; } - $this->extension = array_pop(explode('.', strtolower($this->realname))); + $this->extension = strtolower($this->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; @@ -145,6 +145,20 @@ class filespec } /** + * Get file extension + */ + function get_extension($filename) + { + if (strpos($filename, '.') === false) + { + return ''; + } + + $filename = explode('.', $filename); + return array_pop($filename); + } + + /** * Move file to destination folder * * The phpbb_root_path variable will be applied to the destination path @@ -508,7 +522,11 @@ class fileupload $port = (!empty($url['port'])) ? (int) $url['port'] : 80; $upload_ary['type'] = 'application/octet-stream'; - $upload_ary['name'] = basename($url['path']) . '.' . array_pop(explode('.', $url['path'])); + + $url['path'] = explode('.', $url['path']); + $ext = array_pop($url['path']); + + $upload_ary['name'] = basename($url['path']) . (($ext) ? '.' . $ext : ''); $filename = $url['path']; $filesize = 0; |