Skip to content

Commit 2d9b80a

Browse files
committed
Merge remote-tracking branch 'upstream/5.2-dev' into upmerges/2024-08-28
2 parents db9d95d + f2e0cd0 commit 2d9b80a

File tree

73 files changed

+2998
-1731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2998
-1731
lines changed

administrator/components/com_associations/src/View/Associations/HtmlView.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class HtmlView extends BaseHtmlView
7070
*
7171
* @var string
7272
*
73-
* @since __DEPLOY_VERSION__
73+
* @since 5.2.0
7474
*/
7575
public $extensionName;
7676

@@ -79,7 +79,7 @@ class HtmlView extends BaseHtmlView
7979
*
8080
* @var string
8181
*
82-
* @since __DEPLOY_VERSION__
82+
* @since 5.2.0
8383
*/
8484
public $typeName;
8585

@@ -88,7 +88,7 @@ class HtmlView extends BaseHtmlView
8888
*
8989
* @var string[]
9090
*
91-
* @since __DEPLOY_VERSION__
91+
* @since 5.2.0
9292
*/
9393
public $typeSupports;
9494

@@ -97,7 +97,7 @@ class HtmlView extends BaseHtmlView
9797
*
9898
* @var string[]
9999
*
100-
* @since __DEPLOY_VERSION__
100+
* @since 5.2.0
101101
*/
102102
public $typeFields;
103103

administrator/components/com_categories/src/View/Category/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class HtmlView extends BaseHtmlView
8181
*
8282
* @var string[]
8383
*
84-
* @since __DEPLOY_VERSION__
84+
* @since 5.2.0
8585
*/
8686
public $ignore_fieldsets = [];
8787

administrator/components/com_config/src/View/Component/HtmlView.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class HtmlView extends BaseHtmlView
5656
*
5757
* @var object[]
5858
*
59-
* @since __DEPLOY_VERSION__
59+
* @since 5.2.0
6060
*/
6161
public $fieldsets;
6262

@@ -65,7 +65,7 @@ class HtmlView extends BaseHtmlView
6565
*
6666
* @var string
6767
*
68-
* @since __DEPLOY_VERSION__
68+
* @since 5.2.0
6969
*/
7070
public $formControl;
7171

@@ -74,7 +74,7 @@ class HtmlView extends BaseHtmlView
7474
*
7575
* @var string
7676
*
77-
* @since __DEPLOY_VERSION__
77+
* @since 5.2.0
7878
*/
7979
public $return;
8080

administrator/components/com_contact/src/View/Contact/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class HtmlView extends BaseHtmlView
5757
*
5858
* @var string[]
5959
*
60-
* @since __DEPLOY_VERSION__
60+
* @since 5.2.0
6161
*/
6262
public $ignore_fieldsets = [];
6363

administrator/components/com_content/src/View/Article/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class HtmlView extends BaseHtmlView
7474
*
7575
* @var string[]
7676
*
77-
* @since __DEPLOY_VERSION__
77+
* @since 5.2.0
7878
*/
7979
public $ignore_fieldsets = [];
8080

administrator/components/com_finder/src/View/Filter/HtmlView.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class HtmlView extends BaseHtmlView
7979
*
8080
* @var string[]
8181
*
82-
* @since __DEPLOY_VERSION__
82+
* @since 5.2.0
8383
*/
8484
public $ignore_fieldsets = [];
8585

administrator/components/com_installer/src/Model/InstallModel.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Joomla\CMS\Event\Installer\BeforeInstallationEvent;
1515
use Joomla\CMS\Event\Installer\BeforeInstallerEvent;
1616
use Joomla\CMS\Factory;
17-
use Joomla\CMS\Filesystem\File;
1817
use Joomla\CMS\Installer\Installer;
1918
use Joomla\CMS\Installer\InstallerHelper;
2019
use Joomla\CMS\Language\Text;
@@ -23,6 +22,8 @@
2322
use Joomla\CMS\Router\Route;
2423
use Joomla\CMS\Updater\Update;
2524
use Joomla\CMS\Uri\Uri;
25+
use Joomla\Filesystem\Exception\FilesystemException;
26+
use Joomla\Filesystem\File;
2627
use Joomla\Filesystem\Path;
2728

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

329330
// Move uploaded file.
330-
File::upload($tmp_src, $tmp_dest, false, true);
331+
try {
332+
File::upload($tmp_src, $tmp_dest, false, true);
333+
} catch (FilesystemException $exception) {
334+
Factory::getApplication()->enqueueMessage(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR'), 'error');
335+
336+
return false;
337+
}
331338

332339
// Unpack the downloaded package file.
333340
$package = InstallerHelper::unpack($tmp_dest, true);

administrator/components/com_installer/src/View/Discover/HtmlView.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class HtmlView extends InstallerViewDefault
2929
*
3030
* @var array
3131
*
32-
* @since __DEPLOY_VERSION__
32+
* @since 5.2.0
3333
*/
3434
protected $items;
3535

@@ -38,7 +38,7 @@ class HtmlView extends InstallerViewDefault
3838
*
3939
* @var \Joomla\CMS\Pagination\Pagination
4040
*
41-
* @since __DEPLOY_VERSION__
41+
* @since 5.2.0
4242
*/
4343
protected $pagination;
4444

administrator/components/com_joomlaupdate/src/Model/UpdateModel.php

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Joomla\CMS\Component\ComponentHelper;
1515
use Joomla\CMS\Extension\ExtensionHelper;
1616
use Joomla\CMS\Factory;
17-
use Joomla\CMS\Filesystem\File as FileCMS;
1817
use Joomla\CMS\Filter\InputFilter;
1918
use Joomla\CMS\Http\Http;
2019
use Joomla\CMS\Http\HttpFactory;
@@ -30,6 +29,7 @@
3029
use Joomla\CMS\User\UserHelper;
3130
use Joomla\CMS\Version;
3231
use Joomla\Database\ParameterType;
32+
use Joomla\Filesystem\Exception\FilesystemException;
3333
use Joomla\Filesystem\File;
3434
use Joomla\Registry\Registry;
3535
use Joomla\Utilities\ArrayHelper;
@@ -508,7 +508,11 @@ protected function downloadPackage($url, $target)
508508

509509
// Make sure the target does not exist.
510510
if (is_file($target)) {
511-
File::delete($target);
511+
try {
512+
File::delete($target);
513+
} catch (FilesystemException $exception) {
514+
return false;
515+
}
512516
}
513517

514518
// Download the package
@@ -526,9 +530,9 @@ protected function downloadPackage($url, $target)
526530
$body = $result->body;
527531

528532
// Write the file to disk
529-
$result = File::write($target, $body);
530-
531-
if (!$result) {
533+
try {
534+
File::write($target, $body);
535+
} catch (FilesystemException $exception) {
532536
return false;
533537
}
534538

@@ -611,14 +615,18 @@ public function createUpdateFile($basename = null): bool
611615
$configpath = JPATH_COMPONENT_ADMINISTRATOR . '/update.php';
612616

613617
if (is_file($configpath)) {
614-
File::delete($configpath);
618+
try {
619+
File::delete($configpath);
620+
} catch (FilesystemException $exception) {
621+
return false;
622+
}
615623
}
616624

617625
// Write new file. First try with File.
618-
$result = File::write($configpath, $data);
619-
620-
// In case File failed but direct access could help.
621-
if (!$result) {
626+
try {
627+
$result = File::write($configpath, $data);
628+
} catch (FilesystemException $exception) {
629+
// In case File failed but direct access could help.
622630
$fp = @fopen($configpath, 'wt');
623631

624632
if ($fp !== false) {
@@ -889,18 +897,21 @@ public function cleanUp()
889897

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

892-
if (is_file($tempdir . '/' . $file)) {
893-
File::delete($tempdir . '/' . $file);
894-
}
900+
try {
901+
if (is_file($tempdir . '/' . $file)) {
902+
File::delete($tempdir . '/' . $file);
903+
}
895904

896-
// Remove the update.php file used in Joomla 4.0.3 and later.
897-
if (is_file(JPATH_COMPONENT_ADMINISTRATOR . '/update.php')) {
898-
File::delete(JPATH_COMPONENT_ADMINISTRATOR . '/update.php');
899-
}
905+
// Remove the update.php file used in Joomla 4.0.3 and later.
906+
if (is_file(JPATH_COMPONENT_ADMINISTRATOR . '/update.php')) {
907+
File::delete(JPATH_COMPONENT_ADMINISTRATOR . '/update.php');
908+
}
900909

901-
// Remove joomla.xml from the site's root.
902-
if (is_file(JPATH_ROOT . '/joomla.xml')) {
903-
File::delete(JPATH_ROOT . '/joomla.xml');
910+
// Remove joomla.xml from the site's root.
911+
if (is_file(JPATH_ROOT . '/joomla.xml')) {
912+
File::delete(JPATH_ROOT . '/joomla.xml');
913+
}
914+
} catch (FilesystemException $exception) {
904915
}
905916

906917
// Unset the update filename from the session.
@@ -983,10 +994,10 @@ public function upload()
983994
$tmp_src = $userfile['tmp_name'];
984995

985996
// Move uploaded file.
986-
$result = FileCMS::upload($tmp_src, $tmp_dest, false, true);
987-
988-
if (!$result) {
989-
throw new \RuntimeException(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR'), 500);
997+
try {
998+
File::upload($tmp_src, $tmp_dest, false);
999+
} catch (FilesystemException $exception) {
1000+
throw new \RuntimeException(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLUPLOADERROR'), 500, $exception);
9901001
}
9911002

9921003
Factory::getApplication()->setUserState('com_joomlaupdate.temp_file', $tmp_dest);
@@ -1061,7 +1072,10 @@ public function removePackageFiles()
10611072

10621073
foreach ($files as $file) {
10631074
if ($file !== null && is_file($file)) {
1064-
File::delete($file);
1075+
try {
1076+
File::delete($file);
1077+
} catch (FilesystemException $exception) {
1078+
}
10651079
}
10661080
}
10671081
}

administrator/components/com_languages/tmpl/multilangstatus/default.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@
5555
<?php endif; ?>
5656
<?php endforeach; ?>
5757
<?php endif; ?>
58-
<?php if ($this->defaultHome == true) : ?>
59-
<div class="alert alert-warning">
60-
<span class="icon-exclamation-triangle" aria-hidden="true"></span>
61-
<span class="visually-hidden"><?php echo Text::_('WARNING'); ?></span>
62-
<?php echo Text::_('COM_LANGUAGES_MULTILANGSTATUS_DEFAULT_HOME_MODULE_PUBLISHED'); ?>
63-
</div>
64-
<?php endif; ?>
6558
<?php foreach ($this->statuses as $status) : ?>
6659
<?php // Displays error when Site language and Content language are published but Home page is unpublished, trashed or missing. ?>
6760
<?php if ($status->lang_code && $status->published == 1 && $status->home_published != 1) : ?>

0 commit comments

Comments
 (0)