Skip to content

Commit f4694a2

Browse files
committed
Merge remote-tracking branch 'joomla/4.4-dev' into 5.1/upmerges-2/2024-03-28
2 parents d0ba16f + bdb23b8 commit f4694a2

File tree

8 files changed

+63
-9
lines changed

8 files changed

+63
-9
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
/**
4+
* @package Joomla.Administrator
5+
* @subpackage com_admin
6+
*
7+
* @copyright (C) 2024 Open Source Matters, Inc. <https://www.joomla.org>
8+
* @license GNU General Public License version 2 or later; see LICENSE.txt
9+
*
10+
* This file contains post-installation message handling for notifying users of a change
11+
* in the default .htaccess file regarding setting the Content-Encoding header.
12+
*/
13+
14+
// phpcs:disable PSR1.Files.SideEffects
15+
\defined('_JEXEC') or die;
16+
// phpcs:enable PSR1.Files.SideEffects
17+
18+
/**
19+
* Notifies users of a change in the default .htaccess file regarding setting for brotli to prevent double compression
20+
*
21+
* This check returns true regardless of condition.
22+
*
23+
* @return boolean
24+
*
25+
* @since 4.4.4
26+
*/
27+
function admin_postinstall_htaccessbrotli_condition()
28+
{
29+
return true;
30+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
--
2+
-- Add post-installation message about setting the Content-Encoding header in .htaccess
3+
--
4+
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`)
5+
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';
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
--
2+
-- Add post-installation message about setting the Content-Encoding header in .htaccess
3+
--
4+
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")
5+
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'
6+
ON CONFLICT DO NOTHING;

administrator/language/en-GB/com_admin.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ COM_ADMIN_POSTINSTALL_MSG_HTACCESS_AUTOINDEX_DESCRIPTION="<p>Before 3.9.22 the d
143143
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_AUTOINDEX_TITLE=".htaccess Update Concerning Directory Listings"
144144
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_SETCE_DESCRIPTION="<p>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.</p><p>The old code:</p><pre>Header append Content-Encoding gzip</pre><p>The new code:</p><pre>Header set Content-Encoding gzip</pre>"
145145
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_SETCE_TITLE=".htaccess Update Concerning Setting the Content-Encoding Header"
146+
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_DESCRIPTION="<p>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.</p><p>The old code:</p><pre>RewriteRule \"\.css\.gz$\" \"-\" [T=text/css,E=no-gzip:1]<br>RewriteRule \"\.js\.gz$\" \"-\" [T=text/javascript,E=no-gzip:1]</pre><p>The new code:</p><pre>RewriteRule \"\.css\.gz$\" \"-\" [T=text/css,E=no-gzip:1,E=no-brotli:1]<br>RewriteRule \"\.js\.gz$\" \"-\" [T=text/javascript,E=no-gzip:1,E=no-brotli:1]</pre>"
147+
COM_ADMIN_POSTINSTALL_MSG_HTACCESS_BROTLI_TITLE=".htaccess Update Brotli Compression"
146148
COM_ADMIN_SAVE_SUCCESS="Profile saved."
147149
COM_ADMIN_SESSION_AUTO_START="Session Auto Start"
148150
COM_ADMIN_SESSION_SAVE_PATH="Session Save Path"

components/com_users/src/View/Profile/HtmlView.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,14 @@ public function display($tpl = null)
139139
unset($this->data->text);
140140

141141
// Check for layout from menu item.
142-
$query = Factory::getApplication()->getMenu()->getActive()->query;
142+
$active = Factory::getApplication()->getMenu()->getActive();
143143

144144
if (
145-
isset($query['layout']) && isset($query['option']) && $query['option'] === 'com_users'
146-
&& isset($query['view']) && $query['view'] === 'profile'
145+
$active && isset($active->query['layout'])
146+
&& isset($active->query['option']) && $active->query['option'] === 'com_users'
147+
&& isset($active->query['view']) && $active->query['view'] === 'profile'
147148
) {
148-
$this->setLayout($query['layout']);
149+
$this->setLayout($active->query['layout']);
149150
}
150151

151152
// Escape strings for HTML output

htaccess.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ Options -Indexes
136136
</IfModule>
137137
</IfModule>
138138

139-
## GZIP
139+
## GZIP & BROTLI
140140
## These directives are only enabled if the Apache mod_headers module is enabled.
141141
## This section will check if a .gz file exists and if so will stream it
142142
## directly or fallback to gzip any asset on the fly
@@ -157,9 +157,9 @@ Options -Indexes
157157
RewriteCond "%{REQUEST_FILENAME}\.gz" -s
158158
RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA]
159159

160-
# Serve correct content types, and prevent mod_deflate double gzip.
161-
RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1]
162-
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1]
160+
# Serve correct content types, and prevent mod_deflate double compression.
161+
RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1,E=no-brotli:1]
162+
RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1,E=no-brotli:1]
163163

164164
<FilesMatch "(\.js\.gz|\.css\.gz)$">
165165
# Serve correct encoding type.

libraries/src/MVC/View/ListView.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,13 @@ protected function addToolbar()
251251
$bar->appendButton('Custom', $dhtml, 'batch');
252252
}
253253

254-
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
254+
if (
255+
$canDo->get('core.delete') &&
256+
(
257+
$this->state->get('filter.state') == -2 ||
258+
$this->state->get('filter.published') == -2
259+
)
260+
) {
255261
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', $viewName . '.delete', 'JTOOLBAR_EMPTY_TRASH');
256262
} elseif ($canDo->get('core.edit.state')) {
257263
ToolbarHelper::trash($viewName . '.trash');

plugins/quickicon/phpversioncheck/src/Extension/PhpVersionCheck.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ private function getPhpSupport()
143143
'security' => '2024-12-08',
144144
'eos' => '2025-12-08',
145145
],
146+
'8.3' => [
147+
'security' => '2025-11-23',
148+
'eos' => '2026-11-23',
149+
],
146150
];
147151

148152
// Fill our return array with default values

0 commit comments

Comments
 (0)