Skip to content

Commit

Permalink
Merge branch '4.1-dev' into make-get-response-saving-optional
Browse files Browse the repository at this point in the history
  • Loading branch information
ditsuke committed Feb 3, 2022
2 parents 9ce70d0 + 88b03dd commit a38ebd2
Show file tree
Hide file tree
Showing 158 changed files with 373 additions and 357 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
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
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -5,14 +5,14 @@ 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
---------------------
* This is the source of Joomla! 4.x.
* Joomla's [Official website](https://www.joomla.org).
* Joomla! 4.1 [version history](https://docs.joomla.org/Special:MyLanguage/Joomla_4.1_version_history).
* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/4.0-dev).
* Detailed changes are in the [changelog](https://github.com/joomla/joomla-cms/commits/4.1-dev).

What is Joomla?
---------------------
Expand Down Expand Up @@ -45,9 +45,9 @@ 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.0-dev
git checkout 4.1-dev
```
- Install all the needed composer packages:
```bash
Expand Down
2 changes: 1 addition & 1 deletion README.txt
Expand Up @@ -4,7 +4,7 @@ Joomla! CMS™
* This is a Joomla! 4.x installation/upgrade package.
* Joomla! Official site: https://www.joomla.org
* Joomla! 4.1 version history - https://docs.joomla.org/Special:MyLanguage/Joomla_4.1_version_history
* Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/4.0-dev
* Detailed changes in the Changelog: https://github.com/joomla/joomla-cms/commits/4.1-dev

2- What is Joomla?
* Joomla! is a Content Management System (CMS) which enables you to build websites and powerful online applications.
Expand Down
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
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
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
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
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
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
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
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
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
@@ -0,0 +1,2 @@
ALTER TABLE `#__redirect_links` DROP INDEX `idx_link_modifed`;
ALTER TABLE `#__redirect_links` ADD INDEX `idx_link_modified` (`modified_date`);
@@ -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
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
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
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
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 a38ebd2

Please sign in to comment.