Skip to content

Commit

Permalink
Merge branch '4.1-dev' into 4.2-dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	README.md
#	README.txt
#	administrator/language/en-GB/install.xml
#	administrator/language/en-GB/langmetadata.xml
#	administrator/manifests/files/joomla.xml
#	administrator/manifests/packages/pkg_en-GB.xml
#	api/language/en-GB/install.xml
#	api/language/en-GB/langmetadata.xml
#	installation/language/en-GB/langmetadata.xml
#	language/en-GB/install.xml
#	language/en-GB/langmetadata.xml
#	libraries/src/Version.php
  • Loading branch information
roland-d committed Feb 1, 2022
2 parents f7aacab + 88b03dd commit 93fd3b6
Show file tree
Hide file tree
Showing 148 changed files with 358 additions and 346 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If it is a PR, include what the issue is, what the PR is addressing, testing ins
Please be patient as not all items will be tested immediately (remember, all bug testing for the Joomla! CMS is done by volunteers) and be receptive to feedback about your code.

#### Branches
PRs should usually be made to the `4.0-dev` branch as this contains the most recent version of the code.
PRs should usually be made to the `4.1-dev` branch as this contains the most recent version of the code.
There are other branches available which serve specific purposes.

| Branch | Purpose |
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
/media

# Template CSS files generated by NPM
/administrator/templates/atum/css
/administrator/templates/system/css
/installation/template/css
/templates/cassiopeia/css
/templates/system/css

# Test Related Files
/phpunit.xml
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Build Status
---------------------
| Drone-CI | AppVeyor | PHP | Node | npm |
| ------------- | ------------- | ------------- | ------------- | ------------- |
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=4.0-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/4.0-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V7.2.5-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V12.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v6.13.4-green)](https://nodejs.org/en/) |
| [![Build Status](https://ci.joomla.org/api/badges/joomla/joomla-cms/status.svg?branch=4.1-dev)](https://ci.joomla.org/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/ru6sxal8jmfckvjc/branch/4.1-dev?svg=true)](https://ci.appveyor.com/project/release-joomla/joomla-cms) | [![PHP](https://img.shields.io/badge/PHP-V7.2.5-green)](https://www.php.net/) | [![node-lts](https://img.shields.io/badge/Node-V12.0-green)](https://nodejs.org/en/) | [![npm](https://img.shields.io/badge/npm-v6.13.4-green)](https://nodejs.org/en/) |

Overview
---------------------
Expand Down Expand Up @@ -45,7 +45,7 @@ git clone git@github.com:joomla/joomla-cms.git
```bash
cd joomla-cms
```
- Go to the 4.0-dev branch:
- Go to the 4.1-dev branch:
```bash
git checkout 4.2-dev
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function exportLogs()
// Get the logs data
$data = $model->getLogDataAsIterator($pks);

if (count($data))
if (\count($data))
{
try
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function getOptions()

$options = array();

if (count($context) > 0)
if (\count($context) > 0)
{
foreach ($context as $item)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static function getCsvData($data): Generator
sprintf(
'%s() requires an array or object implementing the Traversable interface, a %s was given.',
__METHOD__,
gettype($data) === 'object' ? get_class($data) : gettype($data)
\gettype($data) === 'object' ? \get_class($data) : \gettype($data)
)
);
}
Expand Down Expand Up @@ -122,7 +122,7 @@ public static function loadTranslationFiles($extension)
case 'plg':
$parts = explode('_', $extension, 3);

if (count($parts) > 2)
if (\count($parts) > 2)
{
$source = JPATH_PLUGINS . '/' . $parts[1] . '/' . $parts[2];
}
Expand Down Expand Up @@ -259,7 +259,7 @@ public static function getContentTypeLink($component, $contentType, $id, $urlVar

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

if (class_exists($cName) && is_callable(array($cName, 'getContentTypeLink')))
if (class_exists($cName) && \is_callable(array($cName, 'getContentTypeLink')))
{
return $cName::getContentTypeLink($contentType, $id, $object);
}
Expand Down Expand Up @@ -367,7 +367,7 @@ protected static function escapeCsvFormula($value)
return $value;
}

if (in_array($value[0], self::$characters, true))
if (\in_array($value[0], self::$characters, true))
{
$value = ' ' . $value;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ protected function sendNotificationEmails($messages, $username, $context)
{
$extensions = json_decode($user->extensions, true);

if ($extensions && in_array(strtok($context, '.'), $extensions))
if ($extensions && \in_array(strtok($context, '.'), $extensions))
{
$recipients[] = $user->email;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ private function getLogDataQuery($pks = null)
->from($db->quoteName('#__action_logs', 'a'))
->join('INNER', $db->quoteName('#__users', 'u') . ' ON ' . $db->quoteName('a.user_id') . ' = ' . $db->quoteName('u.id'));

if (is_array($pks) && count($pks) > 0)
if (\is_array($pks) && \count($pks) > 0)
{
$pks = ArrayHelper::toInteger($pks);
$query->whereIn($db->quoteName('a.id'), $pks);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,27 @@ protected function addLog($messages, $messageLanguageKey, $context, $userId = nu

foreach ($messages as $index => $message)
{
if (!array_key_exists('userid', $message))
if (!\array_key_exists('userid', $message))
{
$message['userid'] = $user->id;
}

if (!array_key_exists('username', $message))
if (!\array_key_exists('username', $message))
{
$message['username'] = $user->username;
}

if (!array_key_exists('accountlink', $message))
if (!\array_key_exists('accountlink', $message))
{
$message['accountlink'] = 'index.php?option=com_users&task=user.edit&id=' . $user->id;
}

if (array_key_exists('type', $message))
if (\array_key_exists('type', $message))
{
$message['type'] = strtoupper($message['type']);
}

if (array_key_exists('app', $message))
if (\array_key_exists('app', $message))
{
$message['app'] = strtoupper($message['app']);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function display($tpl = null)
$this->showIpColumn = (bool) $params->get('ip_logging', 0);
$this->dateRelative = (bool) $params->get('date_relative', 1);

if (count($errors = $model->getErrors()))
if (\count($errors = $model->getErrors()))
{
throw new GenericDataException(implode("\n", $errors), 500);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
use Joomla\Component\Actionlogs\Administrator\Helper\ActionlogsHelper;
use Joomla\Component\Actionlogs\Administrator\View\Actionlogs\HtmlView;

HTMLHelper::_('behavior.multiselect');

/** @var HtmlView $this */

$listOrder = $this->escape($this->state->get('list.ordering'));
Expand All @@ -26,6 +24,7 @@
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('multiselect')
->useScript('com_actionlogs.admin-actionlogs');

?>
Expand Down
19 changes: 10 additions & 9 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -7705,12 +7705,12 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
File::delete(JPATH_ROOT . '/administrator/manifests/packages/pkg_search.xml');
}

if ($suppressOutput === false && \count($status['folders_errors']))
if ($suppressOutput === false && count($status['folders_errors']))
{
echo implode('<br>', $status['folders_errors']);
}

if ($suppressOutput === false && \count($status['files_errors']))
if ($suppressOutput === false && count($status['files_errors']))
{
echo implode('<br>', $status['files_errors']);
}
Expand Down Expand Up @@ -7802,7 +7802,7 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)
}

// Nothing to do if the table doesn't exist because the CMS has never been updated from a pre-4.0 version
if (\count($rows) === 0)
if (count($rows) === 0)
{
return;
}
Expand All @@ -7811,7 +7811,8 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)
$converted = 5;

// Check conversion status in database
$db->setQuery('SELECT ' . $db->quoteName('converted')
$db->setQuery(
'SELECT ' . $db->quoteName('converted')
. ' FROM ' . $db->quoteName('#__utf8_conversion')
);

Expand Down Expand Up @@ -7898,7 +7899,7 @@ public function convertTablesToUtf8mb4($doDbFixMsg = false)

$rows = $db->loadRowList(0);

if (\count($rows) > 0)
if (count($rows) > 0)
{
$db->setQuery($query2)->execute();
}
Expand Down Expand Up @@ -8515,8 +8516,8 @@ protected function moveRemainingTemplateFiles()
{
if (Folder::exists(JPATH_ROOT . $oldFolder))
{
$oldPath = \realpath(JPATH_ROOT . $oldFolder);
$newPath = \realpath(JPATH_ROOT . $newFolder);
$oldPath = realpath(JPATH_ROOT . $oldFolder);
$newPath = realpath(JPATH_ROOT . $newFolder);
$directory = new \RecursiveDirectoryIterator($oldPath);
$directory->setFlags(RecursiveDirectoryIterator::SKIP_DOTS);
$iterator = new \RecursiveIteratorIterator($directory);
Expand All @@ -8532,7 +8533,7 @@ protected function moveRemainingTemplateFiles()
$newFile = $newPath . substr($oldFile, strlen($oldPath));

// Create target folder and parent folders if they don't exist yet
if (is_dir(\dirname($newFile)) || @mkdir(\dirname($newFile), 0755, true))
if (is_dir(dirname($newFile)) || @mkdir(dirname($newFile), 0755, true))
{
File::move($oldFile, $newFile);
}
Expand All @@ -8546,7 +8547,7 @@ protected function moveRemainingTemplateFiles()
*
* @return void
*
* @since __DEPLOY_VERSION__
* @since 4.1.0
*/
protected function fixTemplateMode(): void
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE `#__redirect_links` DROP INDEX `idx_link_modifed`;
ALTER TABLE `#__redirect_links` ADD INDEX `idx_link_modified` (`modified_date`);
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
DROP INDEX IF EXISTS "#__redirect_links_idx_link_modifed";
CREATE INDEX "#__redirect_links_idx_link_modified" ON "#__redirect_links" ("modified_date");
8 changes: 4 additions & 4 deletions administrator/components/com_admin/src/Model/HelpModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class HelpModel extends BaseDatabaseModel
*/
public function &getHelpSearch()
{
if (is_null($this->help_search))
if (\is_null($this->help_search))
{
$this->help_search = Factory::getApplication()->input->getString('helpsearch');
}
Expand All @@ -91,7 +91,7 @@ public function &getHelpSearch()
*/
public function &getPage()
{
if (is_null($this->page))
if (\is_null($this->page))
{
$this->page = Help::createUrl(Factory::getApplication()->input->get('page', 'Start_Here'));
}
Expand All @@ -108,7 +108,7 @@ public function &getPage()
*/
public function getLangTag()
{
if (is_null($this->lang_tag))
if (\is_null($this->lang_tag))
{
$this->lang_tag = Factory::getLanguage()->getTag();

Expand All @@ -129,7 +129,7 @@ public function getLangTag()
*/
public function &getToc()
{
if (!is_null($this->toc))
if (!\is_null($this->toc))
{
return $this->toc;
}
Expand Down
22 changes: 11 additions & 11 deletions administrator/components/com_admin/src/Model/SysinfoModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,12 @@ protected function cleanSectionPrivateData($sectionValues)
$sectionValues = 'xxxxxx';
}

return strlen($sectionValues) ? 'xxxxxx' : '';
return \strlen($sectionValues) ? 'xxxxxx' : '';
}

foreach ($sectionValues as $setting => $value)
{
$sectionValues[$setting] = strlen($value) ? 'xxxxxx' : '';
$sectionValues[$setting] = \strlen($value) ? 'xxxxxx' : '';
}

return $sectionValues;
Expand Down Expand Up @@ -257,13 +257,13 @@ public function &getPhpSettings(): array
'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'),
'mbstring' => extension_loaded('mbstring'),
'gd' => extension_loaded('gd'),
'iconv' => function_exists('iconv'),
'intl' => function_exists('transliterator_transliterate'),
'xml' => \extension_loaded('xml'),
'zlib' => \extension_loaded('zlib'),
'zip' => \function_exists('zip_open') && \function_exists('zip_read'),
'mbstring' => \extension_loaded('mbstring'),
'gd' => \extension_loaded('gd'),
'iconv' => \function_exists('iconv'),
'intl' => \function_exists('transliterator_transliterate'),
'max_input_vars' => ini_get('max_input_vars'),
];

Expand Down Expand Up @@ -393,7 +393,7 @@ public function &getPHPInfo(): string
return $this->php_info;
}

if (!is_null($this->php_info))
if (!\is_null($this->php_info))
{
return $this->php_info;
}
Expand Down Expand Up @@ -482,7 +482,7 @@ public function getExtensions(): array

foreach ($extensions as $extension)
{
if (strlen($extension->name) == 0)
if (\strlen($extension->name) == 0)
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected function renderSection(string $sectionName, array $sectionData, int $l

foreach ($sectionData as $name => $value)
{
if (is_array($value))
if (\is_array($value))
{
if ($name == 'Directive')
{
Expand All @@ -148,12 +148,12 @@ protected function renderSection(string $sectionName, array $sectionData, int $l
}
else
{
if (is_bool($value))
if (\is_bool($value))
{
$value = $value ? 'true' : 'false';
}

if (is_int($name) && ($name == 0 || $name == 1))
if (\is_int($name) && ($name == 0 || $name == 1))
{
$name = ($name == 0 ? 'Local Value' : 'Master Value');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function checkin()
$extension = AssociationsHelper::getSupportedExtension($extensionName);
$types = $extension->get('types');

if (!array_key_exists($typeName, $types))
if (!\array_key_exists($typeName, $types))
{
return;
}
Expand Down

0 comments on commit 93fd3b6

Please sign in to comment.