diff options
author | Cesar G <prototech91@gmail.com> | 2015-04-10 16:23:51 -0700 |
---|---|---|
committer | Cesar G <prototech91@gmail.com> | 2015-04-10 16:23:51 -0700 |
commit | 47514ca2df301631bf9ee2043e347f95f11f57da (patch) | |
tree | 8a77c21a990e3069a7da77116b94fdb3bcd99256 | |
parent | a151ad912a21e9f7ba4d5ef3bbee32b725cd1c5d (diff) | |
download | forums-47514ca2df301631bf9ee2043e347f95f11f57da.tar forums-47514ca2df301631bf9ee2043e347f95f11f57da.tar.gz forums-47514ca2df301631bf9ee2043e347f95f11f57da.tar.bz2 forums-47514ca2df301631bf9ee2043e347f95f11f57da.tar.xz forums-47514ca2df301631bf9ee2043e347f95f11f57da.zip |
[ticket/13755] Ignore dots in path when determining file extension.
PHPBB3-13755
-rw-r--r-- | phpBB/includes/functions_upload.php | 2 | ||||
-rw-r--r-- | tests/upload/filespec_test.php | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index f179b2fd70..89bc31fa25 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -213,6 +213,8 @@ class filespec */ static public function get_extension($filename) { + $filename = utf8_basename($filename); + if (strpos($filename, '.') === false) { return ''; diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php index 05547dcd00..ed28bcb38f 100644 --- a/tests/upload/filespec_test.php +++ b/tests/upload/filespec_test.php @@ -213,6 +213,8 @@ class phpbb_filespec_test extends phpbb_test_case array('file.phpbb.gif', 'gif'), array('file..', ''), array('.file..jpg.webp', 'webp'), + array('/test.com/file', ''), + array('/test.com/file.gif', 'gif'), ); } |