Click to expand the diff!
```diff
diff --git a/administrator/components/com_admin/postinstall/htaccessbrotli.php b/administrator/components/com_admin/postinstall/htaccessbrotli.php
new file mode 100644
index 0000000000000..bc6383f63813b
--- /dev/null
+++ b/administrator/components/com_admin/postinstall/htaccessbrotli.php
@@ -0,0 +1,30 @@
+
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ *
+ * This file contains post-installation message handling for notifying users of a change
+ * in the default .htaccess file regarding setting the Content-Encoding header.
+ */
+
+// phpcs:disable PSR1.Files.SideEffects
+\defined('_JEXEC') or die;
+// phpcs:enable PSR1.Files.SideEffects
+
+/**
+ * Notifies users of a change in the default .htaccess file regarding setting for brotli to prevent double compression
+ *
+ * This check returns true regardless of condition.
+ *
+ * @return boolean
+ *
+ * @since 4.4.4
+ */
+function admin_postinstall_htaccessbrotli_condition()
+{
+ return true;
+}
diff --git a/administrator/components/com_admin/sql/updates/mysql/4.4.4-2024-03-28.sql b/administrator/components/com_admin/sql/updates/mysql/4.4.4-2024-03-28.sql
new file mode 100644
index 0000000000000..0d1ce76be7c38
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/mysql/4.4.4-2024-03-28.sql
@@ -0,0 +1,5 @@
+--
+-- Add post-installation message about setting the Content-Encoding header in .htaccess
+--
+INSERT IGNORE INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`)
+SELECT `extension_id`, 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION', '', 'com_admin', 1, 'message', '', '', 'admin://components/com_admin/postinstall/htaccessbrotli.php', 'admin_postinstall_htaccessbrotli_condition', '4.4.4', 1 FROM `#__extensions` WHERE `name` = 'files_joomla';
diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.4.4-2024-03-28.sql b/administrator/components/com_admin/sql/updates/postgresql/4.4.4-2024-03-28.sql
new file mode 100644
index 0000000000000..b59b29a4a2813
--- /dev/null
+++ b/administrator/components/com_admin/sql/updates/postgresql/4.4.4-2024-03-28.sql
@@ -0,0 +1,6 @@
+--
+-- Add post-installation message about setting the Content-Encoding header in .htaccess
+--
+INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled")
+SELECT "extension_id", 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION', '', 'com_admin', 1, 'message', '', '', 'admin://components/com_admin/postinstall/htaccessbrotli.php', 'admin_postinstall_htaccessbrotli_condition', '4.4.4', 1 FROM "#__extensions" WHERE "name" = 'files_joomla'
+ ON CONFLICT DO NOTHING;
diff --git a/administrator/language/en-GB/com_admin.ini b/administrator/language/en-GB/com_admin.ini
index ce7445a14db71..3e1210859e11d 100644
--- a/administrator/language/en-GB/com_admin.ini
+++ b/administrator/language/en-GB/com_admin.ini
@@ -143,6 +143,8 @@ COM_ADMIN_POSTINSTALL_MSG_HTACCESS_AUTOINDEX_DESCRIPTION="
Before 3.9.22 the d
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_AUTOINDEX_TITLE=".htaccess Update Concerning Directory Listings"
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_SETCE_DESCRIPTION="
Before 4.2.9 the default htaccess.txt file contained erroneous code for appending the \"Content-Encoding\" HTTP header. This could result in double encoding errors when Joomla is installed in a subdirectory and both this directory and its parent directory contain an .htaccess file with this code. You should manually apply the necessary changes to any existing .htaccess file, as this file can not be updated automatically.
The old code:
Header append Content-Encoding gzip
The new code:
Header set Content-Encoding gzip
"
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_SETCE_TITLE=".htaccess Update Concerning Setting the Content-Encoding Header"
+COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION="
Before 4.4.4 the default htaccess.txt did not support Brotli compression. This could result in double compression errors when Joomla is installed on a server that uses Brotli compression. You should manually apply the necessary changes to any existing .htaccess file, as this file can not be updated automatically.
New language relevant PR in upstream repo: https://github.com/joomla/joomla-cms/pull/43177 Here are the upstream changes:
Click to expand the diff!
```diff diff --git a/administrator/components/com_admin/postinstall/htaccessbrotli.php b/administrator/components/com_admin/postinstall/htaccessbrotli.php new file mode 100644 index 0000000000000..bc6383f63813b --- /dev/null +++ b/administrator/components/com_admin/postinstall/htaccessbrotli.php @@ -0,0 +1,30 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + * + * This file contains post-installation message handling for notifying users of a change + * in the default .htaccess file regarding setting the Content-Encoding header. + */ + +// phpcs:disable PSR1.Files.SideEffects +\defined('_JEXEC') or die; +// phpcs:enable PSR1.Files.SideEffects + +/** + * Notifies users of a change in the default .htaccess file regarding setting for brotli to prevent double compression + * + * This check returns true regardless of condition. + * + * @return boolean + * + * @since 4.4.4 + */ +function admin_postinstall_htaccessbrotli_condition() +{ + return true; +} diff --git a/administrator/components/com_admin/sql/updates/mysql/4.4.4-2024-03-28.sql b/administrator/components/com_admin/sql/updates/mysql/4.4.4-2024-03-28.sql new file mode 100644 index 0000000000000..0d1ce76be7c38 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.4.4-2024-03-28.sql @@ -0,0 +1,5 @@ +-- +-- Add post-installation message about setting the Content-Encoding header in .htaccess +-- +INSERT IGNORE INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`) +SELECT `extension_id`, 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION', '', 'com_admin', 1, 'message', '', '', 'admin://components/com_admin/postinstall/htaccessbrotli.php', 'admin_postinstall_htaccessbrotli_condition', '4.4.4', 1 FROM `#__extensions` WHERE `name` = 'files_joomla'; diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.4.4-2024-03-28.sql b/administrator/components/com_admin/sql/updates/postgresql/4.4.4-2024-03-28.sql new file mode 100644 index 0000000000000..b59b29a4a2813 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.4.4-2024-03-28.sql @@ -0,0 +1,6 @@ +-- +-- Add post-installation message about setting the Content-Encoding header in .htaccess +-- +INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled") +SELECT "extension_id", 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_TITLE', 'COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION', '', 'com_admin', 1, 'message', '', '', 'admin://components/com_admin/postinstall/htaccessbrotli.php', 'admin_postinstall_htaccessbrotli_condition', '4.4.4', 1 FROM "#__extensions" WHERE "name" = 'files_joomla' + ON CONFLICT DO NOTHING; diff --git a/administrator/language/en-GB/com_admin.ini b/administrator/language/en-GB/com_admin.ini index ce7445a14db71..3e1210859e11d 100644 --- a/administrator/language/en-GB/com_admin.ini +++ b/administrator/language/en-GB/com_admin.ini @@ -143,6 +143,8 @@ COM_ADMIN_POSTINSTALL_MSG_HTACCESS_AUTOINDEX_DESCRIPTION="Before 3.9.22 the d COM_ADMIN_POSTINSTALL_MSG_HTACCESS_AUTOINDEX_TITLE=".htaccess Update Concerning Directory Listings" COM_ADMIN_POSTINSTALL_MSG_HTACCESS_SETCE_DESCRIPTION="
Before 4.2.9 the default htaccess.txt file contained erroneous code for appending the \"Content-Encoding\" HTTP header. This could result in double encoding errors when Joomla is installed in a subdirectory and both this directory and its parent directory contain an .htaccess file with this code. You should manually apply the necessary changes to any existing .htaccess file, as this file can not be updated automatically.
The old code:
The new code:
" COM_ADMIN_POSTINSTALL_MSG_HTACCESS_SETCE_TITLE=".htaccess Update Concerning Setting the Content-Encoding Header" +COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION="Before 4.4.4 the default htaccess.txt did not support Brotli compression. This could result in double compression errors when Joomla is installed on a server that uses Brotli compression. You should manually apply the necessary changes to any existing .htaccess file, as this file can not be updated automatically.
The old code:
The new code:
" +COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_TITLE=".htaccess Update Brotli Compression" COM_ADMIN_SAVE_SUCCESS="Profile saved." COM_ADMIN_SESSION_AUTO_START="Session Auto Start" COM_ADMIN_SESSION_SAVE_PATH="Session Save Path" diff --git a/components/com_users/src/View/Profile/HtmlView.php b/components/com_users/src/View/Profile/HtmlView.php index 6cca57149707c..e932850b39bc3 100644 --- a/components/com_users/src/View/Profile/HtmlView.php +++ b/components/com_users/src/View/Profile/HtmlView.php @@ -139,13 +139,14 @@ public function display($tpl = null) unset($this->data->text); // Check for layout from menu item. - $query = Factory::getApplication()->getMenu()->getActive()->query; + $active = Factory::getApplication()->getMenu()->getActive(); if ( - isset($query['layout']) && isset($query['option']) && $query['option'] === 'com_users' - && isset($query['view']) && $query['view'] === 'profile' + $active && isset($active->query['layout']) + && isset($active->query['option']) && $active->query['option'] === 'com_users' + && isset($active->query['view']) && $active->query['view'] === 'profile' ) { - $this->setLayout($query['layout']); + $this->setLayout($active->query['layout']); } // Escape strings for HTML output diff --git a/htaccess.txt b/htaccess.txt index a84c35c141453..34c08a2902a51 100644 --- a/htaccess.txt +++ b/htaccess.txt @@ -136,7 +136,7 @@ Options -Indexes -## GZIP +## GZIP & BROTLI ## These directives are only enabled if the Apache mod_headers module is enabled. ## This section will check if a .gz file exists and if so will stream it ## directly or fallback to gzip any asset on the fly @@ -157,9 +157,9 @@ Options -Indexes RewriteCond "%{REQUEST_FILENAME}\.gz" -s RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA] - # Serve correct content types, and prevent mod_deflate double gzip. - RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1] - RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1] + # Serve correct content types, and prevent mod_deflate double compression. + RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1,E=no-brotli:1] + RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1,E=no-brotli:1]