Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
92c1fb4
Update dependencies (#43943)
bembelimen Aug 18, 2024
38dd693
Add deleted files from composer updates (#43944)
richard67 Aug 18, 2024
458d846
Release Joomla! 5.1.3
bembelimen Aug 18, 2024
bbfe0e0
Release Joomla! 4.4.7
bembelimen Aug 19, 2024
22f8289
Revert to dev
bembelimen Aug 20, 2024
8a868a3
Revert to dev
MacJoom Aug 20, 2024
2d707c0
[4.x] Fix paginated page links for com_finder and com_content archive…
SniperSister Aug 22, 2024
ca850cb
Merge remote-tracking branch 'origin/4.4-dev' into 5.1/upmerges/2024-…
LadySolveig Aug 22, 2024
49bc378
Fix cs
LadySolveig Aug 22, 2024
b9b237a
[5.1] Upmerge 2024-08-22
LadySolveig Aug 22, 2024
84cac13
Merge branch 'refs/heads/5.1-dev' into 5.1-5.2-upmerge-2024-08-22
Hackwar Aug 22, 2024
76a2903
Merge pull request #43964 from Hackwar/5.1-5.2-upmerge-2024-08-22
Hackwar Aug 22, 2024
135c3b6
Joomla! 4.4.8 Rc 1
MacJoom Aug 22, 2024
129bd28
Revert to dev
MacJoom Aug 22, 2024
095889c
Release Joomla! 5.1.4 RC1
bembelimen Aug 22, 2024
e975f14
Revert to dev
bembelimen Aug 22, 2024
936f5da
[4.4] Pagination fixes part 2 (#43967)
SniperSister Aug 23, 2024
d8163f8
Merge remote-tracking branch 'origin/4.4-dev' into 5.1/upmerges/2024-…
LadySolveig Aug 23, 2024
6356e59
[5.1] Upmerges 2024-08-23
LadySolveig Aug 23, 2024
3550335
Joomla! 4.4.8 Rc 2
MacJoom Aug 24, 2024
d45157b
Revert to dev
MacJoom Aug 24, 2024
d92aee3
Release Joomla! 5.1.4 RC 2
bembelimen Aug 24, 2024
1de0738
Revert to dev
bembelimen Aug 24, 2024
d03582d
[5.x] Translation Update (#43923)
joomla-translation-bot Aug 25, 2024
b08efee
fix the parameter formats of both, pagination and cache (#43983)
SniperSister Aug 25, 2024
9cb1e31
[5.2] Remove call_user_func() (#41988)
Denitz Aug 25, 2024
9c9dd25
[4.x] Translation Update (#43980)
joomla-translation-bot Aug 25, 2024
f1dbcdb
[5.2] radio basic deprecate (#43860)
brianteeman Aug 25, 2024
321b153
MailBeforeRendering event (#43529)
Fedik Aug 26, 2024
ddf3f3b
new dates (#43984)
tecpromotion Aug 26, 2024
9833057
[5.2] Refactor all instances of File to use framework (#43362)
Hackwar Aug 26, 2024
c75b69b
[5.2] Only register hits on items when GET or POST request (#43231)
Hackwar Aug 26, 2024
2d7667e
[4.4] Escape unsafe tags in mail copy to sender and notification to a…
richard67 Aug 26, 2024
d815c63
Merge remote-tracking branch 'origin/4.4-dev' into 5.1/upmerges/2024-…
LadySolveig Aug 26, 2024
77d3c9a
[5.1] Upmerges 2024-08-26
LadySolveig Aug 26, 2024
35c42fc
Joomla! 5.1.4 Release Candidate 3
LadySolveig Aug 26, 2024
f6bebdd
Reset to dev
LadySolveig Aug 26, 2024
15e1ad9
Joomla! 5.1.4 Stable
LadySolveig Aug 26, 2024
ba9d945
[5.2] Spelling (#43985)
brianteeman Aug 27, 2024
f2e0cd0
Improve UX for template buttons - replace PR #43592 (#43975)
chmst Aug 27, 2024
cb23f07
reset to dev
LadySolveig Aug 27, 2024
35e1d3e
[5.2] Invalid pass-by-reference usage (#41971)
Denitz Aug 28, 2024
153b66d
[5.2][Events] Use event classes for Extension plugins (#43617)
Fedik Aug 28, 2024
f548ea8
Merge branch 'refs/heads/5.1-dev' into 51-52-upmerge-20240828
Hackwar Aug 28, 2024
88bf334
Merge pull request #43993 from Hackwar/51-52-upmerge-20240828
Hackwar Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/create-translation-pull-request-v4.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Create translation pull request
name: Create translation pull request J4

on:
push:
Expand Down
17 changes: 17 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,23 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/cweagans/composer-patches/src/Patches.php',
'/libraries/vendor/cweagans/composer-patches/tests/PatchEventTest.php',
'/libraries/vendor/laminas/laminas-diactoros/PATCHES.txt',
// From 5.1.2 to 5.1.3
'/libraries/vendor/joomla/application/rector.php',
'/libraries/vendor/joomla/console/.drone.jsonnet',
'/libraries/vendor/joomla/console/.drone.yml',
'/libraries/vendor/joomla/database/.drone.jsonnet',
'/libraries/vendor/joomla/database/.drone.yml',
'/libraries/vendor/joomla/database/phpunit.appveyor_sql2012sp1.xml.dist',
'/libraries/vendor/joomla/database/phpunit.appveyor_sql2014.xml.dist',
'/libraries/vendor/joomla/database/phpunit.appveyor_sql2017.xml.dist',
'/libraries/vendor/joomla/database/phpunit.mariadb.xml.dist',
'/libraries/vendor/joomla/database/phpunit.mysql.xml.dist',
'/libraries/vendor/joomla/database/phpunit.mysqli.xml.dist',
'/libraries/vendor/joomla/database/phpunit.pgsql.xml.dist',
'/libraries/vendor/joomla/database/phpunit.sqlite.xml.dist',
'/libraries/vendor/joomla/database/phpunit.sqlsrv.xml.dist',
'/libraries/vendor/joomla/session/.drone.jsonnet',
'/libraries/vendor/joomla/session/.drone.yml',
// From 5.2.0-alpha2 to 5.2.0-alpha3
'/libraries/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/FontAwesome.otf',
'/libraries/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/font-awesome/fonts/fontawesome-webfont.eot',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use Joomla\CMS\Event\Installer\BeforeInstallationEvent;
use Joomla\CMS\Event\Installer\BeforeInstallerEvent;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Installer\InstallerHelper;
use Joomla\CMS\Language\Text;
Expand All @@ -23,6 +22,8 @@
use Joomla\CMS\Router\Route;
use Joomla\CMS\Updater\Update;
use Joomla\CMS\Uri\Uri;
use Joomla\Filesystem\Exception\FilesystemException;
use Joomla\Filesystem\File;
use Joomla\Filesystem\Path;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -327,7 +328,13 @@ protected function _getPackageFromUpload()
$tmp_src = $userfile['tmp_name'];

// Move uploaded file.
File::upload($tmp_src, $tmp_dest, false, true);
try {
File::upload($tmp_src, $tmp_dest, false, true);
} catch (FilesystemException $exception) {
Factory::getApplication()->enqueueMessage(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR'), 'error');

return false;
}

// Unpack the downloaded package file.
$package = InstallerHelper::unpack($tmp_dest, true);
Expand Down
75 changes: 47 additions & 28 deletions administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@

use Joomla\CMS\Authentication\Authentication;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Event\Extension\AfterJoomlaUpdateEvent;
use Joomla\CMS\Event\Extension\BeforeJoomlaUpdateEvent;
use Joomla\CMS\Extension\ExtensionHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\File as FileCMS;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Http\Http;
use Joomla\CMS\Http\HttpFactory;
Expand All @@ -30,6 +31,7 @@
use Joomla\CMS\User\UserHelper;
use Joomla\CMS\Version;
use Joomla\Database\ParameterType;
use Joomla\Filesystem\Exception\FilesystemException;
use Joomla\Filesystem\File;
use Joomla\Registry\Registry;
use Joomla\Utilities\ArrayHelper;
Expand Down Expand Up @@ -508,7 +510,11 @@ protected function downloadPackage($url, $target)

// Make sure the target does not exist.
if (is_file($target)) {
File::delete($target);
try {
File::delete($target);
} catch (FilesystemException $exception) {
return false;
}
}

// Download the package
Expand All @@ -526,9 +532,9 @@ protected function downloadPackage($url, $target)
$body = $result->body;

// Write the file to disk
$result = File::write($target, $body);

if (!$result) {
try {
File::write($target, $body);
} catch (FilesystemException $exception) {
return false;
}

Expand Down Expand Up @@ -576,7 +582,7 @@ public function createUpdateFile($basename = null): bool
$app = Factory::getApplication();

// Trigger event before joomla update.
$app->triggerEvent('onJoomlaBeforeUpdate');
$app->getDispatcher()->dispatch('onJoomlaBeforeUpdate', new BeforeJoomlaUpdateEvent('onJoomlaBeforeUpdate'));

// Get the absolute path to site's root.
$siteroot = JPATH_SITE;
Expand Down Expand Up @@ -611,14 +617,18 @@ public function createUpdateFile($basename = null): bool
$configpath = JPATH_COMPONENT_ADMINISTRATOR . '/update.php';

if (is_file($configpath)) {
File::delete($configpath);
try {
File::delete($configpath);
} catch (FilesystemException $exception) {
return false;
}
}

// Write new file. First try with File.
$result = File::write($configpath, $data);

// In case File failed but direct access could help.
if (!$result) {
try {
$result = File::write($configpath, $data);
} catch (FilesystemException $exception) {
// In case File failed but direct access could help.
$fp = @fopen($configpath, 'wt');

if ($fp !== false) {
Expand Down Expand Up @@ -882,25 +892,29 @@ public function cleanUp()
$app = Factory::getApplication();

// Trigger event after joomla update.
$app->triggerEvent('onJoomlaAfterUpdate');
// @TODO: The event dispatched twice, here and at the end of current method. One of it should be removed.
$app->getDispatcher()->dispatch('onJoomlaAfterUpdate', new AfterJoomlaUpdateEvent('onJoomlaAfterUpdate'));

// Remove the update package.
$tempdir = $app->get('tmp_path');

$file = $app->getUserState('com_joomlaupdate.file', null);

if (is_file($tempdir . '/' . $file)) {
File::delete($tempdir . '/' . $file);
}
try {
if (is_file($tempdir . '/' . $file)) {
File::delete($tempdir . '/' . $file);
}

// Remove the update.php file used in Joomla 4.0.3 and later.
if (is_file(JPATH_COMPONENT_ADMINISTRATOR . '/update.php')) {
File::delete(JPATH_COMPONENT_ADMINISTRATOR . '/update.php');
}
// Remove the update.php file used in Joomla 4.0.3 and later.
if (is_file(JPATH_COMPONENT_ADMINISTRATOR . '/update.php')) {
File::delete(JPATH_COMPONENT_ADMINISTRATOR . '/update.php');
}

// Remove joomla.xml from the site's root.
if (is_file(JPATH_ROOT . '/joomla.xml')) {
File::delete(JPATH_ROOT . '/joomla.xml');
// Remove joomla.xml from the site's root.
if (is_file(JPATH_ROOT . '/joomla.xml')) {
File::delete(JPATH_ROOT . '/joomla.xml');
}
} catch (FilesystemException $exception) {
}

// Unset the update filename from the session.
Expand All @@ -909,7 +923,9 @@ public function cleanUp()
$oldVersion = $app->getUserState('com_joomlaupdate.oldversion');

// Trigger event after joomla update.
$app->triggerEvent('onJoomlaAfterUpdate', [$oldVersion]);
$app->getDispatcher()->dispatch('onJoomlaAfterUpdate', new AfterJoomlaUpdateEvent('onJoomlaAfterUpdate', [
'oldVersion' => $oldVersion ?: '',
]));
$app->setUserState('com_joomlaupdate.oldversion', null);

try {
Expand Down Expand Up @@ -983,10 +999,10 @@ public function upload()
$tmp_src = $userfile['tmp_name'];

// Move uploaded file.
$result = FileCMS::upload($tmp_src, $tmp_dest, false, true);

if (!$result) {
throw new \RuntimeException(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR'), 500);
try {
File::upload($tmp_src, $tmp_dest, false);
} catch (FilesystemException $exception) {
throw new \RuntimeException(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR'), 500, $exception);
}

Factory::getApplication()->setUserState('com_joomlaupdate.temp_file', $tmp_dest);
Expand Down Expand Up @@ -1061,7 +1077,10 @@ public function removePackageFiles()

foreach ($files as $file) {
if ($file !== null && is_file($file)) {
File::delete($file);
try {
File::delete($file);
} catch (FilesystemException $exception) {
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion administrator/components/com_menus/src/Model/MenuModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ protected function populateState()
*
* @since 1.6
*/
public function &getItem($itemId = null)
public function getItem($itemId = null)
{
$itemId = (!empty($itemId)) ? $itemId : (int) $this->getState('menu.id');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function populateState()
*
* @since 1.6
*/
public function &getItem()
public function getItem()
{
$item = new CMSObject();
$userid = (int) $this->getState('user.id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function getItems()
->bind(':clientid', $clientId, ParameterType::INTEGER);

if ($search) {
$search = '%' . str_replace(' ', '%', trim($search), true) . '%';
$search = '%' . str_replace(' ', '%', trim($search)) . '%';
$query->where($db->quoteName('position') . ' LIKE :position')
->bind(':position', $search);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ protected function populateState()
*
* @since 1.6
*/
public function &getTemplate()
public function getTemplate()
{
if (empty($this->template)) {
$pk = (int) $this->getState('extension.id');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,39 +236,9 @@ protected function addToolbar()

// User is global SuperUser
$isSuperUser = $user->authorise('core.admin');
$explodeArray = explode('.', $this->fileName);
$ext = end($explodeArray);

ToolbarHelper::title(Text::sprintf('COM_TEMPLATES_MANAGER_VIEW_TEMPLATE', ucfirst($this->template->name)), 'icon-code thememanager');

// Only show file edit buttons for global SuperUser
if ($isSuperUser) {
// Add an Apply and save button
if ($this->type === 'file') {
$toolbar->apply('template.apply');
$toolbar->save('template.save');
} elseif ($this->type === 'image') {
// Add a Crop and Resize button
$toolbar->standardButton('crop', 'COM_TEMPLATES_BUTTON_CROP', 'template.cropImage')
->listCheck(false)
->icon('icon-crop');
ToolbarHelper::modal('resizeModal', 'icon-expand', 'COM_TEMPLATES_BUTTON_RESIZE');
} elseif ($this->type === 'archive') {
// Add an extract button
$toolbar->standardButton('extract', 'COM_TEMPLATES_BUTTON_EXTRACT_ARCHIVE', 'template.extractArchive')
->listCheck(false)
->icon('icon-chevron-down');
} elseif ($this->type === 'home') {
// Add a copy/child template button
if (isset($this->template->xmldata->inheritable) && (string) $this->template->xmldata->inheritable === '1') {
ToolbarHelper::modal('childModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_TEMPLATE_CHILD');
} elseif (empty($this->template->xmldata->parent) && empty($this->template->xmldata->namespace)) {
// We can't copy parent templates nor namespaced templates
ToolbarHelper::modal('copyModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_COPY_TEMPLATE');
}
}
}

// Add a Template preview button
if ($this->type === 'home') {
$client = (int) $this->preview->client_id === 1 ? 'administrator/' : '';
Expand All @@ -278,6 +248,44 @@ protected function addToolbar()
->attributes(['target' => '_new']);
}

// Only show file edit buttons for global SuperUser
if ($isSuperUser) {
switch ($this->type) {
case 'file':
$toolbar->apply('template.apply');
$toolbar->save('template.save');
$toolbar->cancel('template.close', 'COM_TEMPLATES_BUTTON_CLOSE_FILE');
break;

case 'image':
// Add a Crop and Resize button
$toolbar->standardButton('crop', 'COM_TEMPLATES_BUTTON_CROP', 'template.cropImage')
->listCheck(false)
->icon('icon-crop');
ToolbarHelper::modal('resizeModal', 'icon-expand', 'COM_TEMPLATES_BUTTON_RESIZE');
$toolbar->cancel('template.close', 'COM_TEMPLATES_BUTTON_CLOSE_FILE');
break;

case 'archive':
// Add an extract button
$toolbar->standardButton('extract', 'COM_TEMPLATES_BUTTON_EXTRACT_ARCHIVE', 'template.extractArchive')
->listCheck(false)
->icon('icon-chevron-down');
break;

case 'home':
// Add a copy/child template button
if (isset($this->template->xmldata->inheritable) && (string) $this->template->xmldata->inheritable === '1') {
ToolbarHelper::modal('childModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_TEMPLATE_CHILD');
} elseif (empty($this->template->xmldata->parent) && empty($this->template->xmldata->namespace)) {
// We can't copy parent templates nor namespaced templates
ToolbarHelper::modal('copyModal', 'icon-copy', 'COM_TEMPLATES_BUTTON_COPY_TEMPLATE');
}

break;
}
}

// Only show file manage buttons for global SuperUser
if ($isSuperUser) {
if ($this->type === 'home') {
Expand All @@ -291,7 +299,7 @@ protected function addToolbar()
ToolbarHelper::modal('renameModal', 'icon-sync', 'COM_TEMPLATES_BUTTON_RENAME_FILE');

// Add a Delete file Button
ToolbarHelper::modal('deleteModal', 'icon-times', 'COM_TEMPLATES_BUTTON_DELETE_FILE', 'btn-danger');
ToolbarHelper::modal('deleteModal', 'icon-trash', 'COM_TEMPLATES_BUTTON_DELETE_FILE', 'btn-danger');
}
}

Expand Down Expand Up @@ -320,10 +328,8 @@ protected function addToolbar()
->listCheck(true);
}

if ($this->type === 'home') {
if (!\in_array($this->type, ['image', 'file'])) {
$toolbar->cancel('template.cancel');
} else {
$toolbar->cancel('template.close', 'COM_TEMPLATES_BUTTON_CLOSE_FILE');
}

$toolbar->divider();
Expand Down
2 changes: 1 addition & 1 deletion administrator/language/en-GB/com_templates.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ COM_TEMPLATES_ASSIGNED_1="Assigned to one menu item."
COM_TEMPLATES_ASSIGNED_MORE="Assigned to %d menu items."
COM_TEMPLATES_BUTTON_CHECK="Check Overrides"
COM_TEMPLATES_BUTTON_CHECK_LIST_ENTRY="Mark Checked"
COM_TEMPLATES_BUTTON_CLOSE_FILE="Close File"
COM_TEMPLATES_BUTTON_CLOSE_FILE="Close"
COM_TEMPLATES_BUTTON_COPY_FILE="Copy File"
COM_TEMPLATES_BUTTON_COPY_TEMPLATE="Copy Template"
COM_TEMPLATES_BUTTON_CREATE="Create"
Expand Down
3 changes: 2 additions & 1 deletion components/com_contact/src/Controller/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ private function _sendEmail($data, $contact, $emailCopyToSender)
$mailer->addRecipient($contact->email_to);
$mailer->setReplyTo($templateData['email'], $templateData['name']);
$mailer->addTemplateData($templateData);
$mailer->addUnsafeTags(['name', 'email', 'body', 'customfields']);
$mailer->addUnsafeTags(['name', 'email', 'body']);
$sent = $mailer->send();

// If we are supposed to copy the sender, do so.
Expand All @@ -292,6 +292,7 @@ private function _sendEmail($data, $contact, $emailCopyToSender)
$mailer->addRecipient($templateData['email']);
$mailer->setReplyTo($templateData['email'], $templateData['name']);
$mailer->addTemplateData($templateData);
$mailer->addUnsafeTags(['name', 'email', 'body']);
$sent = $mailer->send();
}
} catch (MailDisabledException | phpMailerException $exception) {
Expand Down
Loading