Skip to content

Commit bd296af

Browse files
authored
Merge pull request #39681 from obuisard/upmerge-2023-01-20
2 parents eadc217 + cf03946 commit bd296af

File tree

1,106 files changed

+6496
-6326
lines changed

Some content is hidden

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

1,106 files changed

+6496
-6326
lines changed

administrator/components/com_actionlogs/src/Controller/ActionlogsController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function exportLogs()
7373

7474
$task = $this->getTask();
7575

76-
$pks = array();
76+
$pks = [];
7777

7878
if ($task == 'exportSelectedLogs') {
7979
// Get selected logs
@@ -116,7 +116,7 @@ public function exportLogs()
116116
}
117117

118118
fclose($output);
119-
$this->app->triggerEvent('onAfterLogExport', array());
119+
$this->app->triggerEvent('onAfterLogExport', []);
120120
$this->app->close();
121121
} else {
122122
$this->setMessage(Text::_('COM_ACTIONLOGS_NO_LOGS_TO_EXPORT'));

administrator/components/com_actionlogs/src/Field/ExtensionField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function getOptions()
5252
$db->setQuery($query);
5353
$context = $db->loadColumn();
5454

55-
$options = array();
55+
$options = [];
5656

5757
if (\count($context) > 0) {
5858
foreach ($context as $item) {

administrator/components/com_actionlogs/src/Field/LogsdaterangeField.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ class LogsdaterangeField extends PredefinedlistField
3939
* @var array
4040
* @since 3.9.0
4141
*/
42-
protected $predefinedOptions = array(
42+
protected $predefinedOptions = [
4343
'today' => 'COM_ACTIONLOGS_OPTION_RANGE_TODAY',
4444
'past_week' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_WEEK',
4545
'past_1month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_1MONTH',
4646
'past_3month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_3MONTH',
4747
'past_6month' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_6MONTH',
4848
'past_year' => 'COM_ACTIONLOGS_OPTION_RANGE_PAST_YEAR',
49-
);
49+
];
5050

5151
/**
5252
* Method to instantiate the form field object.

administrator/components/com_actionlogs/src/Field/PlugininfoField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ protected function getInput()
5757
'link',
5858
Route::_('index.php?option=com_plugins&task=plugin.edit&extension_id=' . $result),
5959
Text::_('PLG_SYSTEM_ACTIONLOGS_JOOMLA_ACTIONLOG_DISABLED'),
60-
array('class' => 'alert-link')
60+
['class' => 'alert-link']
6161
);
6262

6363
return '<div class="alert alert-info">'

administrator/components/com_actionlogs/src/Helper/ActionlogsHelper.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class ActionlogsHelper
3737
*
3838
* @since 3.9.7
3939
*/
40-
private static $characters = array('=', '+', '-', '@');
40+
private static $characters = ['=', '+', '-', '@'];
4141

4242
/**
4343
* Method to convert logs objects array to an iterable type for use with a CSV export
@@ -72,14 +72,14 @@ public static function getCsvData($data): Generator
7272

7373
static::loadTranslationFiles($extension);
7474

75-
yield array(
75+
yield [
7676
'id' => $log->id,
7777
'message' => self::escapeCsvFormula(strip_tags(static::getHumanReadableLogMessage($log, false))),
7878
'extension' => self::escapeCsvFormula(Text::_($extension)),
7979
'date' => (new Date($log->log_date, new \DateTimeZone('UTC')))->format('Y-m-d H:i:s T'),
8080
'name' => self::escapeCsvFormula($log->name),
8181
'ip_address' => self::escapeCsvFormula($log->ip_address === 'COM_ACTIONLOGS_DISABLED' ? $disabledText : $log->ip_address)
82-
);
82+
];
8383
}
8484
}
8585

@@ -94,7 +94,7 @@ public static function getCsvData($data): Generator
9494
*/
9595
public static function loadTranslationFiles($extension)
9696
{
97-
static $cache = array();
97+
static $cache = [];
9898
$extension = strtolower($extension);
9999

100100
if (isset($cache[$extension])) {
@@ -175,7 +175,7 @@ public static function getLogContentTypeParams($context)
175175
*/
176176
public static function getHumanReadableLogMessage($log, $generateLinks = true)
177177
{
178-
static $links = array();
178+
static $links = [];
179179

180180
$message = Text::_($log->message_language_key);
181181
$messageData = json_decode($log->message, true);
@@ -242,7 +242,7 @@ public static function getContentTypeLink($component, $contentType, $id, $urlVar
242242

243243
\JLoader::register($cName, $file);
244244

245-
if (class_exists($cName) && \is_callable(array($cName, 'getContentTypeLink'))) {
245+
if (class_exists($cName) && \is_callable([$cName, 'getContentTypeLink'])) {
246246
return $cName::getContentTypeLink($contentType, $id, $object);
247247
}
248248
}
@@ -273,18 +273,18 @@ public static function loadActionLogPluginsLanguage()
273273
$query = $db->getQuery(true)
274274
->select(
275275
$db->quoteName(
276-
array(
276+
[
277277
'folder',
278278
'element',
279279
'params',
280280
'extension_id'
281-
),
282-
array(
281+
],
282+
[
283283
'type',
284284
'name',
285285
'params',
286286
'id'
287-
)
287+
]
288288
)
289289
)
290290
->from($db->quoteName('#__extensions'))
@@ -297,7 +297,7 @@ public static function loadActionLogPluginsLanguage()
297297
try {
298298
$rows = $db->loadObjectList();
299299
} catch (\RuntimeException $e) {
300-
$rows = array();
300+
$rows = [];
301301
}
302302

303303
if (empty($rows)) {

administrator/components/com_actionlogs/src/Model/ActionlogModel.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function addLog($messages, $messageLanguageKey, $context, $userId = null)
6262
$ip = 'COM_ACTIONLOGS_DISABLED';
6363
}
6464

65-
$loggedMessages = array();
65+
$loggedMessages = [];
6666

6767
foreach ($messages as $message) {
6868
$logMessage = new \stdClass();
@@ -112,7 +112,7 @@ protected function sendNotificationEmails($messages, $username, $context)
112112
$query = $db->getQuery(true);
113113

114114
$query
115-
->select($db->quoteName(array('u.email', 'l.extensions')))
115+
->select($db->quoteName(['u.email', 'l.extensions']))
116116
->from($db->quoteName('#__users', 'u'))
117117
->where($db->quoteName('u.block') . ' = 0')
118118
->join(
@@ -125,7 +125,7 @@ protected function sendNotificationEmails($messages, $username, $context)
125125

126126
$users = $db->loadObjectList();
127127

128-
$recipients = array();
128+
$recipients = [];
129129

130130
foreach ($users as $user) {
131131
$extensions = json_decode($user->extensions, true);

administrator/components/com_actionlogs/src/Model/ActionlogsModel.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ class ActionlogsModel extends ListModel
4444
*
4545
* @throws Exception
4646
*/
47-
public function __construct($config = array())
47+
public function __construct($config = [])
4848
{
4949
if (empty($config['filter_fields'])) {
50-
$config['filter_fields'] = array(
50+
$config['filter_fields'] = [
5151
'a.id', 'id',
5252
'a.extension', 'extension',
5353
'a.user_id', 'user',
5454
'a.message', 'message',
5555
'a.log_date', 'log_date',
5656
'a.ip_address', 'ip_address',
5757
'dateRange',
58-
);
58+
];
5959
}
6060

6161
parent::__construct($config);
@@ -217,7 +217,7 @@ private function buildDateRange($range)
217217
break;
218218
}
219219

220-
return array('dNow' => $dNow, 'dStart' => $dStart);
220+
return ['dNow' => $dNow, 'dStart' => $dStart];
221221
}
222222

223223
/**
@@ -347,7 +347,7 @@ public function delete(&$pks)
347347
return false;
348348
}
349349

350-
Factory::getApplication()->triggerEvent('onAfterLogPurge', array());
350+
Factory::getApplication()->triggerEvent('onAfterLogPurge', []);
351351

352352
return true;
353353
}
@@ -367,7 +367,7 @@ public function purge()
367367
return false;
368368
}
369369

370-
Factory::getApplication()->triggerEvent('onAfterLogPurge', array());
370+
Factory::getApplication()->triggerEvent('onAfterLogPurge', []);
371371

372372
return true;
373373
}
@@ -382,7 +382,7 @@ public function purge()
382382
*
383383
* @since 3.9.0
384384
*/
385-
public function getFilterForm($data = array(), $loadData = true)
385+
public function getFilterForm($data = [], $loadData = true)
386386
{
387387
$form = parent::getFilterForm($data, $loadData);
388388
$params = ComponentHelper::getParams('com_actionlogs');
@@ -392,8 +392,8 @@ public function getFilterForm($data = array(), $loadData = true)
392392
if ($form && $ipLogging) {
393393
/* @var \Joomla\CMS\Form\Field\ListField $field */
394394
$field = $form->getField('fullordering', 'list');
395-
$field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_ASC'), array('value' => 'a.ip_address ASC'));
396-
$field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_DESC'), array('value' => 'a.ip_address DESC'));
395+
$field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_ASC'), ['value' => 'a.ip_address ASC']);
396+
$field->addOption(Text::_('COM_ACTIONLOGS_IP_ADDRESS_DESC'), ['value' => 'a.ip_address DESC']);
397397
}
398398

399399
return $form;

administrator/components/com_actionlogs/tmpl/actionlogs/default.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
<form action="<?php echo Route::_('index.php?option=com_actionlogs&view=actionlogs'); ?>" method="post" name="adminForm" id="adminForm">
3434
<div id="j-main-container" class="j-main-container">
3535
<?php // Search tools bar ?>
36-
<?php echo LayoutHelper::render('joomla.searchtools.default', array('view' => $this)); ?>
36+
<?php echo LayoutHelper::render('joomla.searchtools.default', ['view' => $this]); ?>
3737
<?php if (empty($this->items)) : ?>
3838
<div class="alert alert-info">
3939
<span class="icon-info-circle" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('INFO'); ?></span>

administrator/components/com_admin/postinstall/behindproxy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function admin_postinstall_behindproxy_condition()
5656
function behindproxy_postinstall_action()
5757
{
5858
$prev = ArrayHelper::fromObject(new JConfig());
59-
$data = array_merge($prev, array('behind_loadbalancer' => '1'));
59+
$data = array_merge($prev, ['behind_loadbalancer' => '1']);
6060

6161
$config = new Registry($data);
6262

@@ -71,7 +71,7 @@ function behindproxy_postinstall_action()
7171
}
7272

7373
// Attempt to write the configuration file as a PHP class named JConfig.
74-
$configuration = $config->toString('PHP', array('class' => 'JConfig', 'closingtag' => false));
74+
$configuration = $config->toString('PHP', ['class' => 'JConfig', 'closingtag' => false]);
7575

7676
if (!File::write($file, $configuration)) {
7777
Factory::getApplication()->enqueueMessage(Text::_('COM_CONFIG_ERROR_WRITE_FAILED'), 'error');

administrator/components/com_admin/script.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function update($installer)
8585
$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
8686
$options['text_file'] = 'joomla_update.php';
8787

88-
Log::addLogger($options, Log::INFO, array('Update', 'databasequery', 'jerror'));
88+
Log::addLogger($options, Log::INFO, ['Update', 'databasequery', 'jerror']);
8989

9090
try {
9191
Log::add(Text::_('COM_JOOMLAUPDATE_UPDATE_LOG_DELETE_FILES'), Log::INFO, 'Update');
@@ -539,7 +539,7 @@ protected function updateManifestCaches()
539539

540540
// If we have the search package around, it may not have a manifest cache entry after upgrades from 3.x, so add it to the list
541541
if (File::exists(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml')) {
542-
$extensions[] = array('package', 'pkg_search', '', 0);
542+
$extensions[] = ['package', 'pkg_search', '', 0];
543543
}
544544

545545
// Attempt to refresh manifest caches
@@ -599,7 +599,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
599599
'files_checked' => [],
600600
];
601601

602-
$files = array(
602+
$files = [
603603
// From 3.10 to 4.3
604604
'/administrator/components/com_actionlogs/actionlogs.php',
605605
'/administrator/components/com_actionlogs/controller.php',
@@ -6490,9 +6490,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
64906490
// From 4.3.0-alpha1 to 4.3.0-alpha2
64916491
'/plugins/content/emailcloak/emailcloak.php',
64926492
'/plugins/content/fields/fields.php',
6493-
);
6493+
];
64946494

6495-
$folders = array(
6495+
$folders = [
64966496
// From 3.10 to 4.3
64976497
'/templates/system/images',
64986498
'/templates/system/html',
@@ -7866,7 +7866,7 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
78667866
'/libraries/vendor/symfony/string/Resources/bin',
78677867
// From 4.2.5 to 4.3.0-alpha1
78687868
'/libraries/vendor/paragonie/sodium_compat/dist',
7869-
);
7869+
];
78707870

78717871
$status['files_checked'] = $files;
78727872
$status['folders_checked'] = $folders;
@@ -7939,9 +7939,9 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
79397939
public function updateAssets($installer)
79407940
{
79417941
// List all components added since 4.0
7942-
$newComponents = array(
7942+
$newComponents = [
79437943
// Components to be added here
7944-
);
7944+
];
79457945

79467946
foreach ($newComponents as $component) {
79477947
/** @var \Joomla\CMS\Table\Asset $asset */
@@ -8591,13 +8591,13 @@ private function updateContentTypes(): void
85918591
*/
85928592
protected function fixFilenameCasing()
85938593
{
8594-
$files = array(
8594+
$files = [
85958595
// 3.10 changes
85968596
'/libraries/src/Filesystem/Support/Stringcontroller.php' => '/libraries/src/Filesystem/Support/StringController.php',
85978597
'/libraries/src/Form/Rule/SubFormRule.php' => '/libraries/src/Form/Rule/SubformRule.php',
85988598
// 4.0.0
85998599
'/media/vendor/skipto/js/skipTo.js' => '/media/vendor/skipto/js/skipto.js',
8600-
);
8600+
];
86018601

86028602
foreach ($files as $old => $expected) {
86038603
$oldRealpath = realpath(JPATH_ROOT . $old);

0 commit comments

Comments
 (0)