[feature/avatars] Fix coding guidelines infractions

This commit is contained in:
Marc Alexander 2012-11-12 16:27:45 +01:00
parent 4c4b82416b
commit 940d768592
3 changed files with 12 additions and 5 deletions

View file

@ -330,7 +330,8 @@ class acp_groups
$submit_ary['founder_manage'] = isset($_REQUEST['group_founder_manage']) ? 1 : 0; $submit_ary['founder_manage'] = isset($_REQUEST['group_founder_manage']) ? 1 : 0;
} }
if ($config['allow_avatar']) { if ($config['allow_avatar'])
{
// Handle avatar // Handle avatar
$driver = request_var('avatar_driver', ''); $driver = request_var('avatar_driver', '');
if (in_array($driver, $avatar_drivers) && $config["allow_avatar_$driver"]) if (in_array($driver, $avatar_drivers) && $config["allow_avatar_$driver"])

View file

@ -142,7 +142,8 @@ class phpbb_avatar_driver_core_local extends phpbb_avatar_driver
if ($dh) if ($dh)
{ {
while (($cat = readdir($dh)) !== false) { while (($cat = readdir($dh)) !== false)
{
if ($cat[0] != '.' && preg_match('#^[^&"\'<>]+$#i', $cat) && is_dir("$path/$cat")) if ($cat[0] != '.' && preg_match('#^[^&"\'<>]+$#i', $cat) && is_dir("$path/$cat"))
{ {
if ($ch = @opendir("$path/$cat")) if ($ch = @opendir("$path/$cat"))

View file

@ -72,11 +72,16 @@ class phpbb_avatar_manager
$r = new ReflectionClass($avatar_type); $r = new ReflectionClass($avatar_type);
if ($r->isSubClassOf('phpbb_avatar_driver')) { if ($r->isSubClassOf('phpbb_avatar_driver'))
{
$driver = new $avatar_type($this->config, $this->request, $this->phpbb_root_path, $this->phpEx, $this->cache); $driver = new $avatar_type($this->config, $this->request, $this->phpbb_root_path, $this->phpEx, $this->cache);
} else if ($r->implementsInterface('phpbb_avatar_driver')) { }
else if ($r->implementsInterface('phpbb_avatar_driver'))
{
$driver = new $avatar_type(); $driver = new $avatar_type();
} else { }
else
{
$message = "Invalid avatar driver class name '%s' provided. It must implement phpbb_avatar_driver_interface."; $message = "Invalid avatar driver class name '%s' provided. It must implement phpbb_avatar_driver_interface.";
trigger_error(sprintf($message, $avatar_type)); trigger_error(sprintf($message, $avatar_type));
} }