diff --git a/phpBB/phpbb/template/twig/extension/icon.php b/phpBB/phpbb/template/twig/extension/icon.php index f96ed94821..2cf9bd353e 100644 --- a/phpBB/phpbb/template/twig/extension/icon.php +++ b/phpBB/phpbb/template/twig/extension/icon.php @@ -164,7 +164,7 @@ class icon extends \Twig\Extension\AbstractExtension 'CLASSES' => (string) $classes, 'ICON' => (string) $icon, 'SOURCE' => (string) $source, - 'TITLE' => (string) $title, + 'TITLE' => (string) $title && $type === 'svg' ? unique_id() : '', 'VIEW_BOX' => (string) $view_box, 'S_HIDDEN' => (bool) $hidden, ]); @@ -258,7 +258,7 @@ class icon extends \Twig\Extension\AbstractExtension * 'lock': topicrow.S_TOPIC_LOCKED, * 'fire': topicrow.S_TOPIC_HOT, * 'file': true, - * }, 'MY_TITLE', true) }} + * }, lang('MY_TITLE'), true) }} * * @param array $icons Array of icons and their booleans * @return string The first 'true' icon diff --git a/phpBB/styles/all/template/macros/icons/iconify.twig b/phpBB/styles/all/template/macros/icons/iconify.twig index 5a4387b497..9287bbaf8e 100644 --- a/phpBB/styles/all/template/macros/icons/iconify.twig +++ b/phpBB/styles/all/template/macros/icons/iconify.twig @@ -1,3 +1,4 @@ {% apply spaceless %} - {% if TITLE %}{{ lang(TITLE) }}{% endif %} + +{% if TITLE %}{{ TITLE }}{% endif %} {% endapply %} diff --git a/phpBB/styles/all/template/macros/icons/svg.twig b/phpBB/styles/all/template/macros/icons/svg.twig index 3a2128ff9f..f84b6f3e71 100644 --- a/phpBB/styles/all/template/macros/icons/svg.twig +++ b/phpBB/styles/all/template/macros/icons/svg.twig @@ -1,6 +1,4 @@ {% apply spaceless %} - {% set TITLE_ID = TITLE ? TITLE|lower|replace({' ': '_'}) ~ '-' ~ random() %} -
  • - {{ Icon('iconify', 'fa:cogs', '', false) }}{{ lang('ACP_SHORT') }} + {{ Icon('iconify', 'fa:cogs', lang('ACP_SHORT'), false) }}
  • - {{ Icon('iconify', 'fa:gavel', '', false) }}{{ lang('MCP_SHORT') }} + {{ Icon('iconify', 'fa:gavel', lang('MCP_SHORT'), false) }}
  • diff --git a/tests/template/extension_test.php b/tests/template/extension_test.php index 2320aa2331..a00a89ee46 100644 --- a/tests/template/extension_test.php +++ b/tests/template/extension_test.php @@ -431,8 +431,8 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case [ 'ICON_USER' => 'User icon', ], - ' - User icon + ' + User icon @@ -453,8 +453,8 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case [ 'ICON_PHONE' => 'Phone icon', ], - ' - Phone icon + ' + Phone icon ', @@ -474,8 +474,8 @@ class phpbb_template_extension_test extends phpbb_template_template_test_case [ 'ICON_PENCIL' => 'Pencil icon', ], - '