From 0e4ce1f978e9ba28707d006b719ddabebf2da8dc Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 21 Apr 2020 15:12:28 +0700 Subject: [PATCH 1/4] [ticket/16452] Upgrade to FontAwesome 5 PHPBB3-16452 --- phpBB/adm/style/admin.css | 11 +- phpBB/adm/style/overall_header.html | 1 + phpBB/assets/css/all.min.css | 5 + phpBB/assets/css/font-awesome.min.css | 4 - .../css/phpbb-fontawesome-v4-shims.min.css | 12 + phpBB/assets/fonts/FontAwesome.otf | Bin 134808 -> 0 bytes phpBB/assets/fonts/fontawesome-webfont.eot | Bin 165742 -> 0 bytes phpBB/assets/fonts/fontawesome-webfont.svg | 2671 --------- phpBB/assets/fonts/fontawesome-webfont.ttf | Bin 165548 -> 0 bytes phpBB/assets/fonts/fontawesome-webfont.woff | Bin 98024 -> 0 bytes phpBB/assets/fonts/fontawesome-webfont.woff2 | Bin 77160 -> 0 bytes phpBB/assets/webfonts/fa-brands-400.eot | Bin 0 -> 133034 bytes phpBB/assets/webfonts/fa-brands-400.svg | 3570 ++++++++++++ phpBB/assets/webfonts/fa-brands-400.ttf | Bin 0 -> 132728 bytes phpBB/assets/webfonts/fa-brands-400.woff | Bin 0 -> 89824 bytes phpBB/assets/webfonts/fa-brands-400.woff2 | Bin 0 -> 76612 bytes phpBB/assets/webfonts/fa-regular-400.eot | Bin 0 -> 34390 bytes phpBB/assets/webfonts/fa-regular-400.svg | 803 +++ phpBB/assets/webfonts/fa-regular-400.ttf | Bin 0 -> 34092 bytes phpBB/assets/webfonts/fa-regular-400.woff | Bin 0 -> 16800 bytes phpBB/assets/webfonts/fa-regular-400.woff2 | Bin 0 -> 13584 bytes phpBB/assets/webfonts/fa-solid-900.eot | Bin 0 -> 202902 bytes phpBB/assets/webfonts/fa-solid-900.svg | 4938 +++++++++++++++++ phpBB/assets/webfonts/fa-solid-900.ttf | Bin 0 -> 202616 bytes phpBB/assets/webfonts/fa-solid-900.woff | Bin 0 -> 103300 bytes phpBB/assets/webfonts/fa-solid-900.woff2 | Bin 0 -> 79444 bytes phpBB/includes/functions.php | 5 +- phpBB/includes/functions_acp.php | 4 +- .../data/v33x/font_awesome_5_update.php | 31 + .../prosilver/template/overall_footer.html | 4 +- .../prosilver/template/overall_header.html | 1 + .../prosilver/template/simple_header.html | 1 + phpBB/styles/prosilver/theme/common.css | 2 +- phpBB/styles/prosilver/theme/icons.css | 8 +- 34 files changed, 9383 insertions(+), 2688 deletions(-) create mode 100644 phpBB/assets/css/all.min.css delete mode 100644 phpBB/assets/css/font-awesome.min.css create mode 100644 phpBB/assets/css/phpbb-fontawesome-v4-shims.min.css delete mode 100644 phpBB/assets/fonts/FontAwesome.otf delete mode 100644 phpBB/assets/fonts/fontawesome-webfont.eot delete mode 100644 phpBB/assets/fonts/fontawesome-webfont.svg delete mode 100644 phpBB/assets/fonts/fontawesome-webfont.ttf delete mode 100644 phpBB/assets/fonts/fontawesome-webfont.woff delete mode 100644 phpBB/assets/fonts/fontawesome-webfont.woff2 create mode 100644 phpBB/assets/webfonts/fa-brands-400.eot create mode 100644 phpBB/assets/webfonts/fa-brands-400.svg create mode 100644 phpBB/assets/webfonts/fa-brands-400.ttf create mode 100644 phpBB/assets/webfonts/fa-brands-400.woff create mode 100644 phpBB/assets/webfonts/fa-brands-400.woff2 create mode 100644 phpBB/assets/webfonts/fa-regular-400.eot create mode 100644 phpBB/assets/webfonts/fa-regular-400.svg create mode 100644 phpBB/assets/webfonts/fa-regular-400.ttf create mode 100644 phpBB/assets/webfonts/fa-regular-400.woff create mode 100644 phpBB/assets/webfonts/fa-regular-400.woff2 create mode 100644 phpBB/assets/webfonts/fa-solid-900.eot create mode 100644 phpBB/assets/webfonts/fa-solid-900.svg create mode 100644 phpBB/assets/webfonts/fa-solid-900.ttf create mode 100644 phpBB/assets/webfonts/fa-solid-900.woff create mode 100644 phpBB/assets/webfonts/fa-solid-900.woff2 create mode 100644 phpBB/phpbb/db/migration/data/v33x/font_awesome_5_update.php diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 3243d0eb24..b5a66914f1 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -2639,7 +2639,7 @@ fieldset.permissions .padding { .send-stats-tile h2 { margin-top: 0; text-align: center; - padding-bottom: 1em; + padding-bottom: 1em; } .send-stats-tile i { @@ -2647,7 +2647,8 @@ fieldset.permissions .padding { } .icon { - font-family: FontAwesome; + font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands'; + font-weight: 900; font-style: normal; } @@ -2698,13 +2699,15 @@ fieldset.permissions .padding { } .send-stats-settings input[type=checkbox] + label:before { - content: "\f096"; - font-family: FontAwesome; + content: "\f0c8"; + font-family: 'Font Awesome 5 Free'; + font-weight: normal; font-size: 1.5em; } .send-stats-settings input[type=checkbox]:checked + label:before { content: "\f14a"; + font-weight: bold; color: #3c763d; } diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index fa361d6016..d6f1cf73d7 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -8,6 +8,7 @@ {PAGE_TITLE} + + diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index 905d25096f..1c2d08adf6 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -24,6 +24,7 @@ + diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index eb04c66223..ec278d6471 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -363,7 +363,7 @@ a.header-avatar img { a.header-avatar span:after { content: '\f0dd'; display: inline-block; - font: normal normal normal 14px/1 FontAwesome; + font: normal normal bold 14px/1 'Font Awesome 5 Free'; padding-left: 6px; padding-top: 2px; vertical-align: top; diff --git a/phpBB/styles/prosilver/theme/icons.css b/phpBB/styles/prosilver/theme/icons.css index 3ac598486c..9d5ccc1488 100644 --- a/phpBB/styles/prosilver/theme/icons.css +++ b/phpBB/styles/prosilver/theme/icons.css @@ -11,10 +11,10 @@ */ .icon, .button .icon, blockquote cite:before, .uncited:before { display: inline-block; - font-weight: normal; + font-weight: 900; font-style: normal; font-variant: normal; - font-family: FontAwesome; + font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands'; font-size: 14px; line-height: 1; text-rendering: auto; /* optimizelegibility throws things off #1094 */ @@ -22,9 +22,9 @@ -moz-osx-font-smoothing: grayscale; } -.icon:before { padding-right: 2px; } +.icon { padding-right: 2px; } -.button .icon:before { +.button .icon { padding-right: 0; } From 335535e73ba927be9c077550a855549a61b4e1cd Mon Sep 17 00:00:00 2001 From: rxu Date: Tue, 21 Apr 2020 16:04:02 +0700 Subject: [PATCH 2/4] [ticket/16452] Fix tests PHPBB3-16452 --- tests/functional/forum_style_test.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/functional/forum_style_test.php b/tests/functional/forum_style_test.php index b3c1115b7f..dd9fe7790e 100644 --- a/tests/functional/forum_style_test.php +++ b/tests/functional/forum_style_test.php @@ -19,25 +19,25 @@ class phpbb_functional_forum_style_test extends phpbb_functional_test_case public function test_font_awesome_style() { $crawler = self::request('GET', 'viewtopic.php?t=1&f=2'); - $this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); + $this->assertContains('all.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1'); - $this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); + $this->assertContains('all.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1&view=next'); - $this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); + $this->assertContains('all.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); } public function test_default_forum_style() { $crawler = self::request('GET', 'viewtopic.php?t=1&f=2'); - $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1'); - $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1&view=next'); - $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertContains('styles/prosilver/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); } public function test_custom_forum_style() @@ -47,13 +47,13 @@ class phpbb_functional_forum_style_test extends phpbb_functional_test_case $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 2 WHERE forum_id = 2'); $crawler = self::request('GET', 'viewtopic.php?t=1&f=2'); - $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1'); - $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1&view=next'); - $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(1)->attr('href')); + $this->assertContains('styles/test_style/', $crawler->filter('head > link[rel=stylesheet]')->eq(2)->attr('href')); $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_style = 0 WHERE forum_id = 2'); $this->delete_style(2, 'test_style'); From 628d39931f8888c534a602f7d89b6ba736c131bc Mon Sep 17 00:00:00 2001 From: rxu Date: Wed, 22 Apr 2020 13:31:52 +0700 Subject: [PATCH 3/4] [ticket/16452] Rename all.min back to font-awesome.min PHPBB3-16452 --- phpBB/assets/css/{all.min.css => font-awesome.min.css} | 0 phpBB/includes/functions.php | 2 +- phpBB/includes/functions_acp.php | 2 +- phpBB/styles/prosilver/template/overall_footer.html | 2 +- tests/functional/forum_style_test.php | 6 +++--- 5 files changed, 6 insertions(+), 6 deletions(-) rename phpBB/assets/css/{all.min.css => font-awesome.min.css} (100%) diff --git a/phpBB/assets/css/all.min.css b/phpBB/assets/css/font-awesome.min.css similarity index 100% rename from phpBB/assets/css/all.min.css rename to phpBB/assets/css/font-awesome.min.css diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 0cc8cf6fea..440f868882 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4065,7 +4065,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id = 'T_STYLESHEET_LINK' => "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/stylesheet.css?assets_version=' . $config['assets_version'], 'T_STYLESHEET_LANG_LINK'=> "{$web_path}styles/" . rawurlencode($user->style['style_path']) . '/theme/' . $user->lang_name . '/stylesheet.css?assets_version=' . $config['assets_version'], - 'T_FONT_AWESOME_LINK' => !empty($config['allow_cdn']) && !empty($config['load_font_awesome_url']) ? $config['load_font_awesome_url'] : "{$web_path}assets/css/all.min.css?assets_version=" . $config['assets_version'], + 'T_FONT_AWESOME_LINK' => !empty($config['allow_cdn']) && !empty($config['load_font_awesome_url']) ? $config['load_font_awesome_url'] : "{$web_path}assets/css/font-awesome.min.css?assets_version=" . $config['assets_version'], 'T_FONT_AWESOME_V4SHIMS_LINK' => "{$web_path}assets/css/phpbb-fontawesome-v4-shims.min.css?assets_version=" . $config['assets_version'], 'T_JQUERY_LINK' => !empty($config['allow_cdn']) && !empty($config['load_jquery_url']) ? $config['load_jquery_url'] : "{$web_path}assets/javascript/jquery-3.4.1.min.js?assets_version=" . $config['assets_version'], diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php index 606799877b..a013af2c89 100644 --- a/phpBB/includes/functions_acp.php +++ b/phpBB/includes/functions_acp.php @@ -89,7 +89,7 @@ function adm_page_header($page_title) 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/", 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/", - 'T_FONT_AWESOME_LINK' => !empty($config['allow_cdn']) && !empty($config['load_font_awesome_url']) ? $config['load_font_awesome_url'] : "{$phpbb_root_path}assets/css/all.min.css?assets_version=" . $config['assets_version'], + 'T_FONT_AWESOME_LINK' => !empty($config['allow_cdn']) && !empty($config['load_font_awesome_url']) ? $config['load_font_awesome_url'] : "{$phpbb_root_path}assets/css/font-awesome.min.css?assets_version=" . $config['assets_version'], 'T_FONT_AWESOME_V4SHIMS_LINK' => "{$phpbb_root_path}assets/css/phpbb-fontawesome-v4-shims.min.css?assets_version=" . $config['assets_version'], 'T_ASSETS_VERSION' => $config['assets_version'], diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html index fd9b931b3c..2213c3af9c 100644 --- a/phpBB/styles/prosilver/template/overall_footer.html +++ b/phpBB/styles/prosilver/template/overall_footer.html @@ -74,7 +74,7 @@ var $fa_cdn = $('head').find('link[rel="stylesheet"]').first(), $span = $('').appendTo('body'); if ($span.css('fontFamily') !== 'Font Awesome 5 Free' ) { - $fa_cdn.after(''); + $fa_cdn.after(''); $fa_cdn.remove(); } $span.remove(); diff --git a/tests/functional/forum_style_test.php b/tests/functional/forum_style_test.php index dd9fe7790e..2f75517f8f 100644 --- a/tests/functional/forum_style_test.php +++ b/tests/functional/forum_style_test.php @@ -19,13 +19,13 @@ class phpbb_functional_forum_style_test extends phpbb_functional_test_case public function test_font_awesome_style() { $crawler = self::request('GET', 'viewtopic.php?t=1&f=2'); - $this->assertContains('all.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); + $this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1'); - $this->assertContains('all.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); + $this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); $crawler = self::request('GET', 'viewtopic.php?t=1&view=next'); - $this->assertContains('all.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); + $this->assertContains('font-awesome.min', $crawler->filter('head > link[rel=stylesheet]')->eq(0)->attr('href')); } public function test_default_forum_style() From 77745e466d17f6255d6728d9022c254f9e05c841 Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 23 Apr 2020 02:07:56 +0700 Subject: [PATCH 4/4] [ticket/16452] Minor css code style adjustments PHPBB3-16452 --- phpBB/adm/style/admin.css | 10 +++++----- phpBB/styles/prosilver/theme/common.css | 2 +- phpBB/styles/prosilver/theme/icons.css | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index b5a66914f1..ac842a8812 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -2647,7 +2647,7 @@ fieldset.permissions .padding { } .icon { - font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands'; + font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands"; font-weight: 900; font-style: normal; } @@ -2699,15 +2699,15 @@ fieldset.permissions .padding { } .send-stats-settings input[type=checkbox] + label:before { - content: "\f0c8"; - font-family: 'Font Awesome 5 Free'; - font-weight: normal; + font-family: "Font Awesome 5 Free"; font-size: 1.5em; + font-weight: normal; + content: "\f0c8"; } .send-stats-settings input[type=checkbox]:checked + label:before { - content: "\f14a"; font-weight: bold; + content: "\f14a"; color: #3c763d; } diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index ec278d6471..e356bc9f18 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -363,7 +363,7 @@ a.header-avatar img { a.header-avatar span:after { content: '\f0dd'; display: inline-block; - font: normal normal bold 14px/1 'Font Awesome 5 Free'; + font: normal normal bold 14px/1 "Font Awesome 5 Free"; padding-left: 6px; padding-top: 2px; vertical-align: top; diff --git a/phpBB/styles/prosilver/theme/icons.css b/phpBB/styles/prosilver/theme/icons.css index 9d5ccc1488..e3919a227e 100644 --- a/phpBB/styles/prosilver/theme/icons.css +++ b/phpBB/styles/prosilver/theme/icons.css @@ -11,10 +11,10 @@ */ .icon, .button .icon, blockquote cite:before, .uncited:before { display: inline-block; + font-family: "Font Awesome 5 Free", "Font Awesome 5 Brands"; font-weight: 900; font-style: normal; font-variant: normal; - font-family: 'Font Awesome 5 Free', 'Font Awesome 5 Brands'; font-size: 14px; line-height: 1; text-rendering: auto; /* optimizelegibility throws things off #1094 */