mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/13755] Ignore dots in path when determining file extension.
PHPBB3-13755
This commit is contained in:
parent
a151ad912a
commit
47514ca2df
2 changed files with 4 additions and 0 deletions
|
@ -213,6 +213,8 @@ class filespec
|
||||||
*/
|
*/
|
||||||
static public function get_extension($filename)
|
static public function get_extension($filename)
|
||||||
{
|
{
|
||||||
|
$filename = utf8_basename($filename);
|
||||||
|
|
||||||
if (strpos($filename, '.') === false)
|
if (strpos($filename, '.') === false)
|
||||||
{
|
{
|
||||||
return '';
|
return '';
|
||||||
|
|
|
@ -213,6 +213,8 @@ class phpbb_filespec_test extends phpbb_test_case
|
||||||
array('file.phpbb.gif', 'gif'),
|
array('file.phpbb.gif', 'gif'),
|
||||||
array('file..', ''),
|
array('file..', ''),
|
||||||
array('.file..jpg.webp', 'webp'),
|
array('.file..jpg.webp', 'webp'),
|
||||||
|
array('/test.com/file', ''),
|
||||||
|
array('/test.com/file.gif', 'gif'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue