1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-11 03:04:09 +02:00

[feature/avatars] Move list of supported formats to avatar driver class

Using the regex and turning it into an array if necessary seemed like the
cleanest approach to achieve this.

PHPBB3-10018
This commit is contained in:
Marc Alexander
2013-01-25 01:24:15 +01:00
parent 869de98f52
commit 9c3538eb0e
4 changed files with 8 additions and 3 deletions

View File

@@ -162,7 +162,7 @@ class phpbb_avatar_driver_local extends phpbb_avatar_driver
$image = $file_info->getFilename();
// Match all images in the gallery folder
if (preg_match('#^[^&\'"<>]+\.(?:gif|png|jpe?g)$#i', $image) && is_file($file_path . '/' . $image))
if (preg_match('#^[^&\'"<>]+\.(?:'. self::REGEX_ALLOWED_EXT . ')$#i', $image) && is_file($file_path . '/' . $image))
{
if (function_exists('getimagesize'))
{