Skip to content

Commit

Permalink
Merge branch '5.1-dev' into mod-version
Browse files Browse the repository at this point in the history
  • Loading branch information
LadySolveig committed Feb 24, 2024
2 parents 6be703c + 164724b commit 1256730
Show file tree
Hide file tree
Showing 175 changed files with 1,792 additions and 1,300 deletions.
4 changes: 2 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@
'@PSR12' => true,
// Short array syntax
'array_syntax' => ['syntax' => 'short'],
// Lists should not have a trailing comma like list($foo, $bar,) = ...
'no_trailing_comma_in_list_call' => true,
// List of values separated by a comma is contained on a single line should not have a trailing comma like [$foo, $bar,] = ...
'no_trailing_comma_in_singleline' => true,
// Arrays on multiline should have a trailing comma
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
// Align elements in multiline array and variable declarations on new lines below each other
Expand Down
30 changes: 15 additions & 15 deletions administrator/components/com_admin/src/Model/SysinfoModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,17 @@ public function &getPhpSettings(): array
}

$this->php_settings = [
'memory_limit' => ini_get('memory_limit'),
'upload_max_filesize' => ini_get('upload_max_filesize'),
'post_max_size' => ini_get('post_max_size'),
'display_errors' => ini_get('display_errors') == '1',
'short_open_tag' => ini_get('short_open_tag') == '1',
'file_uploads' => ini_get('file_uploads') == '1',
'output_buffering' => (int) ini_get('output_buffering') !== 0,
'open_basedir' => ini_get('open_basedir'),
'session.save_path' => ini_get('session.save_path'),
'session.auto_start' => ini_get('session.auto_start'),
'disable_functions' => ini_get('disable_functions'),
'memory_limit' => \ini_get('memory_limit'),
'upload_max_filesize' => \ini_get('upload_max_filesize'),
'post_max_size' => \ini_get('post_max_size'),
'display_errors' => \ini_get('display_errors') == '1',
'short_open_tag' => \ini_get('short_open_tag') == '1',
'file_uploads' => \ini_get('file_uploads') == '1',
'output_buffering' => (int) \ini_get('output_buffering') !== 0,
'open_basedir' => \ini_get('open_basedir'),
'session.save_path' => \ini_get('session.save_path'),
'session.auto_start' => \ini_get('session.auto_start'),
'disable_functions' => \ini_get('disable_functions'),
'xml' => \extension_loaded('xml'),
'zlib' => \extension_loaded('zlib'),
'zip' => \function_exists('zip_open') && \function_exists('zip_read'),
Expand All @@ -263,7 +263,7 @@ public function &getPhpSettings(): array
'gd' => \extension_loaded('gd'),
'iconv' => \function_exists('iconv'),
'intl' => \function_exists('transliterator_transliterate'),
'max_input_vars' => ini_get('max_input_vars'),
'max_input_vars' => \ini_get('max_input_vars'),
];

return $this->php_settings;
Expand Down Expand Up @@ -355,7 +355,7 @@ private function getCompatPluginParameters()
public function phpinfoEnabled(): bool
{
// remove any spaces from the ini value before exploding it
$disabledFunctions = str_replace(' ', '', ini_get('disable_functions'));
$disabledFunctions = str_replace(' ', '', \ini_get('disable_functions'));
return !\in_array('phpinfo', explode(',', $disabledFunctions));
}

Expand Down Expand Up @@ -666,7 +666,7 @@ public function getDirectory(bool $public = false): array
*/
private function addDirectory(string $name, string $path, string $message = ''): void
{
$this->directories[$name] = ['writable' => is_writable($path), 'message' => $message,];
$this->directories[$name] = ['writable' => is_writable($path), 'message' => $message];
}

/**
Expand Down Expand Up @@ -718,7 +718,7 @@ protected function parsePhpInfo(string $html): array
foreach ($vals as $val) {
// 3cols
if (preg_match($p2, $val, $matches)) {
$r[$name][trim($matches[1])] = [trim($matches[2]), trim($matches[3]),];
$r[$name][trim($matches[1])] = [trim($matches[2]), trim($matches[3])];
} elseif (preg_match($p3, $val, $matches)) {
// 2cols
$r[$name][trim($matches[1])] = trim($matches[2]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,12 @@ protected function addToolbar(): void
. Text::_('COM_ASSOCIATIONS_SAVE_REFERENCE') . '</button></joomla-toolbar-button>');

$toolbar->customButton('target')
->html('<joomla-toolbar-button><button onclick="Joomla.submitbutton(\'target\')" '
->html('<joomla-toolbar-button id="toolbar-target"><button onclick="Joomla.submitbutton(\'target\')" '
. 'class="btn btn-success"><span class="icon-save" aria-hidden="true"></span>'
. Text::_('COM_ASSOCIATIONS_SAVE_TARGET') . '</button></joomla-toolbar-button>');

if ($this->typeName === 'category' || $this->extensionName === 'com_menus' || $this->save2copy === true) {
$toolbar->standardButton('', 'COM_ASSOCIATIONS_COPY_REFERENCE', 'copy')
$toolbar->standardButton('copy', 'COM_ASSOCIATIONS_COPY_REFERENCE', 'copy')
->icon('icon-copy')
->listCheck(false);
}
Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_banners/forms/banner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@
<field
name="imageurl"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_BANNERS_FIELD_IMAGE_LABEL"
directory="banners"
hide_none="1"
Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_categories/forms/category.xml
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@
<field
name="image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CATEGORIES_FIELD_IMAGE_LABEL"
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ protected function getListQuery()
$categoryId = $categoryId ? [$categoryId] : [];
}

// Case: Using both categories filter and by level filter
if (\count($categoryId)) {
// Case: Using both categories filter and by level filter
$categoryTable = Table::getInstance('Category', 'JTable');
$subCatItemsWhere = [];

Expand All @@ -263,9 +263,8 @@ protected function getListQuery()
}

$query->where('(' . implode(' OR ', $subCatItemsWhere) . ')');

// Case: Using only the by level filter
} elseif ($level) {
// Case: Using only the by level filter
$query->where($db->quoteName('a.level') . ' <= :level')
->bind(':level', $level, ParameterType::INTEGER);
}
Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_config/forms/application.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,9 @@
<field
name="offline_image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONFIG_FIELD_OFFLINE_IMAGE_LABEL"
showon="offline:1"
/>
Expand Down
24 changes: 24 additions & 0 deletions administrator/components/com_contact/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@
<field
name="image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_PARAMS_IMAGE_LABEL"
default=""
showon="show_info:1[AND]show_image:1"
Expand Down Expand Up @@ -410,6 +413,9 @@
<field
name="icon_address"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_ADDRESS_LABEL"
hide_none="1"
default=""
Expand All @@ -419,6 +425,9 @@
<field
name="icon_email"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_EMAIL_LABEL"
hide_none="1"
default=""
Expand All @@ -428,6 +437,9 @@
<field
name="icon_telephone"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_TELEPHONE_LABEL"
hide_none="1"
default=""
Expand All @@ -437,6 +449,9 @@
<field
name="icon_mobile"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_MOBILE_LABEL"
hide_none="1"
default=""
Expand All @@ -446,6 +461,9 @@
<field
name="icon_fax"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_FAX_LABEL"
hide_none="1"
default=""
Expand All @@ -455,6 +473,9 @@
<field
name="icon_webpage"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_WEBPAGE_LABEL"
hide_none="1"
default=""
Expand All @@ -464,6 +485,9 @@
<field
name="icon_misc"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_ICONS_MISC_LABEL"
hide_none="1"
default=""
Expand Down
3 changes: 3 additions & 0 deletions administrator/components/com_contact/forms/contact.xml
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@
<field
name="image"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTACT_FIELD_PARAMS_IMAGE_LABEL"
hide_none="1"
/>
Expand Down
6 changes: 6 additions & 0 deletions administrator/components/com_content/forms/article.xml
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,9 @@
name="image_intro"
type="media"
label="COM_CONTENT_FIELD_INTRO_LABEL"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
/>

<field
Expand Down Expand Up @@ -759,6 +762,9 @@
<field
name="image_fulltext"
type="media"
schemes="http,https,ftp,ftps,data,file"
validate="url"
relative="true"
label="COM_CONTENT_FIELD_FULL_LABEL"
/>

Expand Down
6 changes: 3 additions & 3 deletions administrator/components/com_finder/src/Indexer/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -922,20 +922,20 @@ protected function translateState($item, $category = null)

// Translate the state
switch ($item) {
// Published items should always show up in search results
case 1:
// Published items should always show up in search results
return 1;

// Archived items should only show up when option is enabled
case 2:
// Archived items should only show up when option is enabled
if ($this->params->get('search_archived', 1) == 0) {
return 0;
}

return 1;

// All other states should return an unpublished state
default:
// All other states should return an unpublished state
return 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,13 +920,13 @@ protected function translateState($item, $category = null)

// Translate the state
switch ($item) {
// Published and archived items only should return a published state
case 1:
case 2:
// Published and archived items only should return a published state
return 1;

// All other states should return an unpublished state
default:
// All other states should return an unpublished state
return 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Html extends Parser
public function parse($input)
{
// Strip invalid UTF-8 characters.
$oldSetting = ini_get('mbstring.substitute_character');
$oldSetting = \ini_get('mbstring.substitute_character');
ini_set('mbstring.substitute_character', 'none');
$input = mb_convert_encoding($input, 'UTF-8', 'UTF-8');
ini_set('mbstring.substitute_character', $oldSetting);
Expand Down
4 changes: 2 additions & 2 deletions administrator/components/com_finder/src/Indexer/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,9 @@ protected function processString($input, $lang, $mode)

// Now we have to handle the filter string.
switch ($modifier) {
// Handle a before and after date filters.
case 'before':
case 'after':
// Handle a before and after date filters.
// Get the time offset.
$offset = Factory::getApplication()->get('offset');

Expand All @@ -820,8 +820,8 @@ protected function processString($input, $lang, $mode)

break;

// Handle a taxonomy branch filter.
default:
// Handle a taxonomy branch filter.
// Try to find the node id.
$return = Taxonomy::getNodeByTitle($modifier, $value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ class GuidedtoursComponent extends MVCComponent implements BootableExtensionInte
/**
* An interactive step for checkbox/radio fields
*
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
public const STEP_INTERACTIVETYPE_CHECKBOX_RADIO = 5;

/**
* An interactive step for select element fields
*
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
public const STEP_INTERACTIVETYPE_SELECT = 6;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function __construct(DatabaseDriver $db, DispatcherInterface $dispatcher
* @return mixed Null if operation was satisfactory, otherwise returns an error
*
* @see Table::bind()
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
public function bind($array, $ignore = '')
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public function loadChangelog()
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 5.1.0
*/
public function loadChangelogRaw()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected function _getPackageFromUpload()
$userfile = $input->files->get('install_package', null, 'raw');

// Make sure that file uploads are enabled in php.
if (!(bool) ini_get('file_uploads')) {
if (!(bool) \ini_get('file_uploads')) {
Factory::getApplication()->enqueueMessage(Text::_('COM_INSTALLER_MSG_INSTALL_WARNINSTALLFILE'), 'error');

return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected function translate(&$items)
break;
case 'file':
$extension = 'files_' . $item->element;
$lang->load("$extension.sys", JPATH_SITE);
$lang->load("$extension.sys", JPATH_SITE);
break;
case 'library':
$parts = explode('/', $item->element);
Expand Down

0 comments on commit 1256730

Please sign in to comment.