Skip to content

Commit 84d325c

Browse files
committed
Merge remote-tracking branch 'upstream/5.2-dev' into upmerges/2024-08-14
2 parents c854508 + da20f93 commit 84d325c

File tree

3 files changed

+28
-13
lines changed

3 files changed

+28
-13
lines changed

libraries/src/Console/UpdateCoreCommand.php

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
use Joomla\Application\Cli\CliInput;
1313
use Joomla\CMS\Extension\ExtensionHelper;
1414
use Joomla\CMS\Factory;
15-
use Joomla\CMS\Filesystem\File;
1615
use Joomla\CMS\Filesystem\Folder;
1716
use Joomla\CMS\Installer\InstallerHelper;
1817
use Joomla\CMS\Language\Text;
1918
use Joomla\CMS\Log\Log;
2019
use Joomla\Console\Command\AbstractCommand;
2120
use Joomla\Database\DatabaseInterface;
21+
use Joomla\Filesystem\Exception\FilesystemException;
22+
use Joomla\Filesystem\File;
2223
use Symfony\Component\Console\Helper\ProgressBar;
2324
use Symfony\Component\Console\Input\InputInterface;
2425
use Symfony\Component\Console\Output\OutputInterface;
@@ -298,13 +299,20 @@ private function updateJoomlaCore($updatemodel): bool
298299
// Remove the administrator/cache/autoload_psr4.php file
299300
$autoloadFile = JPATH_CACHE . '/autoload_psr4.php';
300301

301-
if (file_exists($autoloadFile)) {
302-
File::delete($autoloadFile);
303-
}
304-
305-
// Remove the xml
306-
if (file_exists(JPATH_BASE . '/joomla.xml')) {
307-
File::delete(JPATH_BASE . '/joomla.xml');
302+
try {
303+
if (file_exists($autoloadFile)) {
304+
File::delete($autoloadFile);
305+
}
306+
307+
// Remove the xml
308+
if (file_exists(JPATH_BASE . '/joomla.xml')) {
309+
File::delete(JPATH_BASE . '/joomla.xml');
310+
}
311+
} catch (FilesystemException $exception) {
312+
$this->progressBar->clear();
313+
$this->ioStyle->error($exception->getMessage());
314+
$this->progressBar->display();
315+
$this->progressBar->advance();
308316
}
309317

310318
InstallerHelper::cleanupInstall($package['file'], $package['extractdir']);

plugins/api-authentication/token/src/Extension/Token.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ public function onUserAuthenticate(AuthenticationEvent $event): void
252252
$response->username = $user->username;
253253
$response->email = $user->email;
254254
$response->fullname = $user->name;
255-
$response->timezone = $user->get('timezone');
256-
$response->language = $user->get('language');
255+
$response->timezone = $user->getParam('timezone', $this->getApplication()->get('offset', 'UTC'));
256+
$response->language = $user->getParam('language', $this->getApplication()->get('language'));
257257

258258
// Stop event propagation when status is STATUS_SUCCESS
259259
$event->stopPropagation();

plugins/task/rotatelogs/src/Extension/RotateLogs.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010

1111
namespace Joomla\Plugin\Task\RotateLogs\Extension;
1212

13-
use Joomla\CMS\Filesystem\File;
1413
use Joomla\CMS\Plugin\CMSPlugin;
1514
use Joomla\Component\Scheduler\Administrator\Event\ExecuteTaskEvent;
1615
use Joomla\Component\Scheduler\Administrator\Task\Status;
1716
use Joomla\Component\Scheduler\Administrator\Traits\TaskPluginTrait;
1817
use Joomla\Database\DatabaseAwareTrait;
1918
use Joomla\Event\SubscriberInterface;
19+
use Joomla\Filesystem\Exception\FilesystemException;
20+
use Joomla\Filesystem\File;
2021
use Joomla\Filesystem\Folder;
2122
use Joomla\Filesystem\Path;
2223

@@ -100,7 +101,10 @@ private function rotateLogs(ExecuteTaskEvent $event): int
100101
if ($version >= $logsToKeep) {
101102
// Delete files which have version greater than or equals $logsToKeep
102103
foreach ($files as $file) {
103-
File::delete($logPath . '/' . $file);
104+
try {
105+
File::delete($logPath . '/' . $file);
106+
} catch (FilesystemException $exception) {
107+
}
104108
}
105109
} else {
106110
// For files which have version smaller than $logsToKeep, rotate (increase version number)
@@ -140,7 +144,10 @@ private function rotate($path, $filename, $currentVersion)
140144
$rotatedFile = $path . '/' . implode('.', $parts);
141145
}
142146

143-
File::move($path . '/' . $filename, $rotatedFile);
147+
try {
148+
File::move($path . '/' . $filename, $rotatedFile);
149+
} catch (FilesystemException $exception) {
150+
}
144151
}
145152

146153
/**

0 commit comments

Comments
 (0)