From 2d47f858013dea3f73f467d332503e4216437823 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Tue, 3 Jun 2014 00:31:17 +0200 Subject: [PATCH] [ticket/12457] Default to first category if none is selected in gallery avatar If any category exists, the key() function should always return the first key of the $avatar_list array. PHPBB3-12457 --- phpBB/phpbb/avatar/driver/local.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php index 00e519e3f2..c9e6781205 100644 --- a/phpBB/phpbb/avatar/driver/local.php +++ b/phpBB/phpbb/avatar/driver/local.php @@ -36,7 +36,7 @@ class local extends \phpbb\avatar\driver\driver public function prepare_form($request, $template, $user, $row, &$error) { $avatar_list = $this->get_avatar_list($user); - $category = $request->variable('avatar_local_cat', ''); + $category = $request->variable('avatar_local_cat', key($avatar_list)); foreach ($avatar_list as $cat => $null) {