From ed064ce0f16a31c1803791e13f7051a39860f59d Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 28 May 2015 15:36:27 +0200 Subject: [PATCH 1/4] [ticket/13799] Do not rawurlencode category in gallery avatar Otherwise the directory seperator will incorrectly be transformed to its HTML replacement. PHPBB3-13799 --- 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 36087f8ba0..f19daa6b75 100644 --- a/phpBB/phpbb/avatar/driver/local.php +++ b/phpBB/phpbb/avatar/driver/local.php @@ -182,7 +182,7 @@ class local extends \phpbb\avatar\driver\driver } $cat = ($path == $file_path) ? $user->lang['NO_AVATAR_CATEGORY'] : str_replace("$path/", '', $file_path); $avatar_list[$cat][$image] = array( - 'file' => ($cat != $user->lang['NO_AVATAR_CATEGORY']) ? rawurlencode($cat) . '/' . rawurlencode($image) : rawurlencode($image), + 'file' => ($cat != $user->lang['NO_AVATAR_CATEGORY']) ? $cat . '/' . rawurlencode($image) : rawurlencode($image), 'filename' => rawurlencode($image), 'name' => ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $image))), 'width' => $dims[0], From 1ba86eaa8e25a63107fd9c0ab60fa9c2c2e488f8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sat, 30 May 2015 11:54:54 +0200 Subject: [PATCH 2/4] [ticket/13799] Correctly urlencode category and show selected avatar PHPBB3-13799 --- phpBB/adm/style/acp_avatar_options_local.html | 2 +- phpBB/phpbb/avatar/driver/local.php | 6 ++++-- .../styles/prosilver/template/ucp_avatar_options_local.html | 2 +- .../subsilver2/template/ucp_avatar_options_local.html | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/phpBB/adm/style/acp_avatar_options_local.html b/phpBB/adm/style/acp_avatar_options_local.html index 8adafa1d99..bee3c57ea0 100644 --- a/phpBB/adm/style/acp_avatar_options_local.html +++ b/phpBB/adm/style/acp_avatar_options_local.html @@ -12,7 +12,7 @@
  • + checked="checked" />
  • diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php index f19daa6b75..75c384f31e 100644 --- a/phpBB/phpbb/avatar/driver/local.php +++ b/phpBB/phpbb/avatar/driver/local.php @@ -84,11 +84,13 @@ class local extends \phpbb\avatar\driver\driver 'AVATAR_IMAGE' => $this->phpbb_root_path . $this->config['avatar_gallery_path'] . '/' . $img['file'], 'AVATAR_NAME' => $img['name'], 'AVATAR_FILE' => $img['filename'], + 'CHECKED' => $img['file'] === $row['avatar'], )); $template->assign_block_vars('avatar_local_row.avatar_local_option', array( 'AVATAR_FILE' => $img['filename'], - 'S_OPTIONS_AVATAR' => $img['filename'] + 'S_OPTIONS_AVATAR' => $img['filename'], + 'CHECKED' => $img['file'] === $row['avatar'], )); $col_count = ($col_count + 1) % $table_cols; @@ -182,7 +184,7 @@ class local extends \phpbb\avatar\driver\driver } $cat = ($path == $file_path) ? $user->lang['NO_AVATAR_CATEGORY'] : str_replace("$path/", '', $file_path); $avatar_list[$cat][$image] = array( - 'file' => ($cat != $user->lang['NO_AVATAR_CATEGORY']) ? $cat . '/' . rawurlencode($image) : rawurlencode($image), + 'file' => ($cat != $user->lang['NO_AVATAR_CATEGORY']) ? str_replace('%2F', '/', rawurlencode($cat)) . '/' . rawurlencode($image) : rawurlencode($image), 'filename' => rawurlencode($image), 'name' => ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $image))), 'width' => $dims[0], diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_local.html b/phpBB/styles/prosilver/template/ucp_avatar_options_local.html index 2a0f403782..66f36a8138 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options_local.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options_local.html @@ -10,7 +10,7 @@ + checked="checked" /> diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html index 919cf49e44..95db7bc2ae 100644 --- a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html +++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html @@ -19,7 +19,7 @@ - + checked="checked" /> From 0427e5f1b3cde07bd153e03577f2384cfd963795 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 4 Jun 2015 18:14:52 +0200 Subject: [PATCH 3/4] [ticket/13799] Add missing space before checked attribute PHPBB3-13799 --- phpBB/styles/prosilver/template/ucp_avatar_options_local.html | 2 +- phpBB/styles/subsilver2/template/ucp_avatar_options_local.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_local.html b/phpBB/styles/prosilver/template/ucp_avatar_options_local.html index 66f36a8138..0cc72e7621 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options_local.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options_local.html @@ -10,7 +10,7 @@ + checked="checked" /> diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html index 95db7bc2ae..8b77a81398 100644 --- a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html +++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html @@ -19,7 +19,7 @@ - checked="checked" /> + checked="checked" /> From 5b8a721b73122ee25b332ac06ce723c8756acead Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Thu, 4 Jun 2015 18:21:05 +0200 Subject: [PATCH 4/4] [ticket/13799] Split lines in HTML files for better readability PHPBB3-13799 --- .../styles/prosilver/template/ucp_avatar_options_local.html | 3 ++- .../subsilver2/template/ucp_avatar_options_local.html | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_local.html b/phpBB/styles/prosilver/template/ucp_avatar_options_local.html index 0cc72e7621..80c7f28ca3 100644 --- a/phpBB/styles/prosilver/template/ucp_avatar_options_local.html +++ b/phpBB/styles/prosilver/template/ucp_avatar_options_local.html @@ -10,7 +10,8 @@ + checked="checked" /> diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html index 8b77a81398..921126ba22 100644 --- a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html +++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html @@ -19,7 +19,11 @@ - checked="checked" /> + checked="checked" /> +