Skip to content

Commit

Permalink
Merge branch '4.3-dev' into fix_ldap_ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Jan 30, 2023
2 parents f36071b + 9a3ade1 commit 6fb31c7
Show file tree
Hide file tree
Showing 27 changed files with 122 additions and 78 deletions.
6 changes: 4 additions & 2 deletions libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -922,8 +922,10 @@ public function logout($userid = null, $options = [])
$user = Factory::getUser($userid);

// Build the credentials array.
$parameters['username'] = $user->get('username');
$parameters['id'] = $user->get('id');
$parameters = [
'username' => $user->get('username'),
'id' => $user->get('id'),
];

// Set clientid in the options array if it hasn't been set already and shared sessions are not enabled.
if (!$this->get('shared_session', '0') && !isset($options['clientid'])) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Cache/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ public static function setWorkarounds($data, $options = [])
}

// View body data
$cached['body'] = $data;
$cached = ['body' => $data];

// Document head data
if ($loptions['nohead'] != 1 && method_exists($document, 'getHeadData')) {
Expand Down
12 changes: 7 additions & 5 deletions libraries/src/Console/AddUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,13 @@ protected function doExecute(InputInterface $input, OutputInterface $output): in
// Get filter to remove invalid characters
$filter = new InputFilter();

$user['username'] = $filter->clean($this->user, 'USERNAME');
$user['password'] = $this->password;
$user['name'] = $filter->clean($this->name, 'STRING');
$user['email'] = $this->email;
$user['groups'] = $this->userGroups;
$user = [
'username' => $filter->clean($this->user, 'USERNAME'),
'password' => $this->password,
'name' => $filter->clean($this->name, 'STRING'),
'email' => $this->email,
'groups' => $this->userGroups,
];

$userObj = User::getInstance();
$userObj->bind($user);
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Dispatcher/ApiDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function dispatch()
$task = $this->input->getCmd('task', 'display');

// Build controller config data
$config['option'] = $this->option;
$config = ['option' => $this->option];

// Set name of controller if it is passed in the request
if ($this->input->exists('controller')) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Dispatcher/ComponentDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public function dispatch()
}

// Build controller config data
$config['option'] = $this->option;
$config = ['option' => $this->option];

// Set name of controller if it is passed in the request
if ($this->input->exists('controller')) {
Expand Down
24 changes: 13 additions & 11 deletions libraries/src/Editor/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,19 @@ public function display($name, $html, $width, $height, $col, $row, $buttons = tr
$width = str_replace(';', '', $width);
$height = str_replace(';', '', $height);

$args['name'] = $name;
$args['content'] = $html;
$args['width'] = $width;
$args['height'] = $height;
$args['col'] = $col;
$args['row'] = $row;
$args['buttons'] = $buttons;
$args['id'] = $id ?: $name;
$args['asset'] = $asset;
$args['author'] = $author;
$args['params'] = $params;
$args = [
'name' => $name,
'content' => $html,
'width' => $width,
'height' => $height,
'col' => $col,
'row' => $row,
'buttons' => $buttons,
'id' => ($id ?: $name),
'asset' => $asset,
'author' => $author,
'params' => $params,
];

return \call_user_func_array([$this->_editor, 'onDisplay'], $args);
}
Expand Down
2 changes: 2 additions & 0 deletions libraries/src/Form/Field/DatabaseconnectionField.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class DatabaseconnectionField extends ListField
*/
protected function getOptions()
{
$options = [];

// This gets the connectors available in the platform and supported by the server.
$available = array_map('strtolower', DatabaseDriver::getConnectors());

Expand Down
112 changes: 64 additions & 48 deletions libraries/src/HTML/Helpers/Bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,14 @@ public static function carousel($selector = '', $params = []): void

if ($selector !== '') {
// Setup options object
$opt['interval'] = isset($params['interval']) ? (int) $params['interval'] : 5000;
$opt['keyboard'] = isset($params['keyboard']) ? (bool) $params['keyboard'] : true;
$opt['pause'] = isset($params['pause']) ? $params['pause'] : 'hover';
$opt['slide'] = isset($params['slide']) ? (bool) $params['slide'] : false;
$opt['wrap'] = isset($params['wrap']) ? (bool) $params['wrap'] : true;
$opt['touch'] = isset($params['touch']) ? (bool) $params['touch'] : true;
$opt = [
'interval' => (isset($params['interval']) ? (int) $params['interval'] : 5000),
'keyboard' => (isset($params['keyboard']) ? (bool) $params['keyboard'] : true),
'pause' => (isset($params['pause']) ? $params['pause'] : 'hover'),
'slide' => (isset($params['slide']) ? (bool) $params['slide'] : false),
'wrap' => (isset($params['wrap']) ? (bool) $params['wrap'] : true),
'touch' => (isset($params['touch']) ? (bool) $params['touch'] : true),
];

Factory::getDocument()->addScriptOptions('bootstrap.carousel', [$selector => (object) array_filter((array) $opt)]);
}
Expand Down Expand Up @@ -271,9 +273,11 @@ public static function modal($selector = '', $options = []): void

if ($selector !== '') {
// Setup options object
$opt['backdrop'] = isset($options['backdrop']) ? $options['backdrop'] : false;
$opt['keyboard'] = isset($options['keyboard']) ? (bool) $options['keyboard'] : true;
$opt['focus'] = isset($options['focus']) ? (bool) $options['focus'] : true;
$opt = [
'backdrop' => (isset($options['backdrop']) ? $options['backdrop'] : false),
'keyboard' => (isset($options['keyboard']) ? (bool) $options['keyboard'] : true),
'focus' => (isset($options['focus']) ? (bool) $options['focus'] : true),
];

Factory::getDocument()->addScriptOptions('bootstrap.modal', [$selector => (object) array_filter((array) $opt)]);
}
Expand Down Expand Up @@ -311,9 +315,11 @@ public static function offcanvas($selector = '', $options = []): void

if ($selector !== '') {
// Setup options object
$opt['backdrop'] = isset($options['backdrop']) ? (bool) $options['backdrop'] : true;
$opt['keyboard'] = isset($options['keyboard']) ? (bool) $options['keyboard'] : true;
$opt['scroll'] = isset($options['scroll']) ? (bool) $options['scroll'] : false;
$opt = [
'backdrop' => (isset($options['backdrop']) ? (bool) $options['backdrop'] : true),
'keyboard' => (isset($options['keyboard']) ? (bool) $options['keyboard'] : true),
'scroll' => (isset($options['scroll']) ? (bool) $options['scroll'] : false),
];

Factory::getDocument()->addScriptOptions('bootstrap.offcanvas', [$selector => (object) array_filter((array) $opt)]);
}
Expand Down Expand Up @@ -366,22 +372,24 @@ public static function popover($selector = '', $options = []): void

if ($selector !== '') {
// Setup options object
$opt['animation'] = isset($options['animation']) ? (bool) $options['animation'] : true;
$opt['container'] = isset($options['container']) ? $options['container'] : 'body';
$opt['content'] = isset($options['content']) ? $options['content'] : null;
$opt['delay'] = isset($options['delay']) ? (int) $options['delay'] : [ 'show' => 50, 'hide' => 200 ];
$opt['html'] = isset($options['html']) ? (bool) $options['html'] : true;
$opt['placement'] = isset($options['placement']) ? $options['placement'] : null;
$opt['selector'] = isset($options['selector']) ? $options['selector'] : false;
$opt['template'] = isset($options['template']) ? $options['template'] : null;
$opt['title'] = isset($options['title']) ? $options['title'] : null;
$opt['trigger'] = isset($options['trigger']) ? $options['trigger'] : 'click';
$opt['offset'] = isset($options['offset']) ? $options['offset'] : [0, 10];
$opt['fallbackPlacement'] = isset($options['fallbackPlacement']) ? $options['fallbackPlacement'] : null;
$opt['boundary'] = isset($options['boundary']) ? $options['boundary'] : 'scrollParent';
$opt['customClass'] = isset($options['customClass']) ? $options['customClass'] : null;
$opt['sanitize'] = isset($options['sanitize']) ? (bool) $options['sanitize'] : null;
$opt['allowList'] = isset($options['allowList']) ? $options['allowList'] : null;
$opt = [
'animation' => isset($options['animation']) ? (bool) $options['animation'] : true,
'container' => isset($options['container']) ? $options['container'] : 'body',
'content' => isset($options['content']) ? $options['content'] : null,
'delay' => isset($options['delay']) ? (int) $options['delay'] : [ 'show' => 50, 'hide' => 200 ],
'html' => isset($options['html']) ? (bool) $options['html'] : true,
'placement' => isset($options['placement']) ? $options['placement'] : null,
'selector' => isset($options['selector']) ? $options['selector'] : false,
'template' => isset($options['template']) ? $options['template'] : null,
'title' => isset($options['title']) ? $options['title'] : null,
'trigger' => isset($options['trigger']) ? $options['trigger'] : 'click',
'offset' => isset($options['offset']) ? $options['offset'] : [0, 10],
'fallbackPlacement' => isset($options['fallbackPlacement']) ? $options['fallbackPlacement'] : null,
'boundary' => isset($options['boundary']) ? $options['boundary'] : 'scrollParent',
'customClass' => isset($options['customClass']) ? $options['customClass'] : null,
'sanitize' => isset($options['sanitize']) ? (bool) $options['sanitize'] : null,
'allowList' => isset($options['allowList']) ? $options['allowList'] : null,
];

Factory::getDocument()->addScriptOptions('bootstrap.popover', [$selector => (object) array_filter((array) $opt)]);
}
Expand Down Expand Up @@ -419,9 +427,11 @@ public static function scrollspy($selector = '', $options = []): void

if ($selector !== '') {
// Setup options object
$opt['offset'] = isset($options['offset']) ? (int) $options['offset'] : 10;
$opt['method'] = isset($options['method']) ? $options['method'] : 'auto';
$opt['target'] = isset($options['target']) ? $options['target'] : null;
$opt = [
'offset' => isset($options['offset']) ? (int) $options['offset'] : 10,
'method' => isset($options['method']) ? $options['method'] : 'auto',
'target' => isset($options['target']) ? $options['target'] : null,
];

Factory::getDocument()->addScriptOptions('bootstrap.scrollspy', [$selector => (object) array_filter((array) $opt)]);
}
Expand Down Expand Up @@ -506,20 +516,22 @@ public static function tooltip($selector = '', $options = []): void

if ($selector !== '') {
// Setup options object
$opt['animation'] = isset($options['animation']) ? (bool) $options['animation'] : true;
$opt['container'] = isset($options['container']) ? $options['container'] : 'body';
$opt['delay'] = isset($options['delay']) ? (int) $options['delay'] : 0;
$opt['html'] = isset($options['html']) ? (bool) $options['html'] : true;
$opt['placement'] = isset($options['placement']) ? $options['placement'] : null;
$opt['selector'] = isset($options['selector']) ? $options['selector'] : false;
$opt['template'] = isset($options['template']) ? $options['template'] : null;
$opt['title'] = isset($options['title']) ? $options['title'] : null;
$opt['trigger'] = isset($options['trigger']) ? $options['trigger'] : 'hover focus';
$opt['fallbackPlacement'] = isset($options['fallbackPlacement']) ? $options['fallbackPlacement'] : null;
$opt['boundary'] = isset($options['boundary']) ? $options['boundary'] : 'clippingParents';
$opt['customClass'] = isset($options['customClass']) ? $options['customClass'] : null;
$opt['sanitize'] = isset($options['sanitize']) ? (bool) $options['sanitize'] : true;
$opt['allowList'] = isset($options['allowList']) ? $options['allowList'] : null;
$opt = [
'animation' => isset($options['animation']) ? (bool) $options['animation'] : true,
'container' => isset($options['container']) ? $options['container'] : 'body',
'delay' => isset($options['delay']) ? (int) $options['delay'] : 0,
'html' => isset($options['html']) ? (bool) $options['html'] : true,
'placement' => isset($options['placement']) ? $options['placement'] : null,
'selector' => isset($options['selector']) ? $options['selector'] : false,
'template' => isset($options['template']) ? $options['template'] : null,
'title' => isset($options['title']) ? $options['title'] : null,
'trigger' => isset($options['trigger']) ? $options['trigger'] : 'hover focus',
'fallbackPlacement' => isset($options['fallbackPlacement']) ? $options['fallbackPlacement'] : null,
'boundary' => isset($options['boundary']) ? $options['boundary'] : 'clippingParents',
'customClass' => isset($options['customClass']) ? $options['customClass'] : null,
'sanitize' => isset($options['sanitize']) ? (bool) $options['sanitize'] : true,
'allowList' => isset($options['allowList']) ? $options['allowList'] : null,
];

Factory::getDocument()->addScriptOptions('bootstrap.tooltip', [$selector => (object) array_filter((array) $opt)]);
}
Expand Down Expand Up @@ -555,9 +567,11 @@ public static function toast($selector = '', $options = []): void

if ($selector !== '') {
// Setup options object
$opt['animation'] = isset($options['animation']) ? (string) $options['animation'] : null;
$opt['autohide'] = isset($options['autohide']) ? (bool) $options['autohide'] : true;
$opt['delay'] = isset($options['delay']) ? (int) $options['delay'] : 5000;
$opt = [
'animation' => isset($options['animation']) ? (string) $options['animation'] : null,
'autohide' => isset($options['autohide']) ? (bool) $options['autohide'] : true,
'delay' => isset($options['delay']) ? (int) $options['delay'] : 5000,
];

Factory::getDocument()->addScriptOptions('bootstrap.toast', [$selector => (object) array_filter((array) $opt)]);
}
Expand Down Expand Up @@ -646,6 +660,7 @@ public static function startAccordion($selector = 'myAccordian', $options = []):
->useScript('bootstrap.collapse');

// Setup options object
$opt = [];
$opt['parent'] = isset($options['parent']) ?
($options['parent'] == true ? '#' . preg_replace('/^[\.#]/', '', $selector) : $options['parent']) : '';
$opt['toggle'] = isset($options['toggle']) ? (bool) $options['toggle'] : !($opt['parent'] === false || isset($options['active']));
Expand Down Expand Up @@ -785,6 +800,7 @@ public static function startTabSet($selector = 'myTab', $params = []): string

if (!isset(static::$loaded[__METHOD__][$sig])) {
// Setup options object
$opt = [];
$opt['active'] = (isset($params['active']) && ($params['active'])) ? (string) $params['active'] : '';

// Initialise with the Joomla specifics
Expand Down
2 changes: 2 additions & 0 deletions libraries/src/HTML/Helpers/JGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public static function action(
$checkbox = 'cb',
$formId = null
) {
$html = [];

if (is_array($prefix)) {
$options = $prefix;
$activeTitle = array_key_exists('active_title', $options) ? $options['active_title'] : $activeTitle;
Expand Down
1 change: 1 addition & 0 deletions libraries/src/HTML/Helpers/Telephone.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ abstract class Telephone
*/
public static function tel($number, $displayplan)
{
$display = [];
$number = explode('.', $number);
$countrycode = $number[0];
$number = $number[1];
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/HTML/Helpers/UiTab.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static function startTabSet($selector = 'myTab', $params = [])
->useScript('webcomponent.joomla-tab');

// Setup options object
$opt['active'] = (isset($params['active']) && ($params['active'])) ? (string) $params['active'] : '';
$opt = ['active' => (isset($params['active']) && ($params['active'])) ? (string) $params['active'] : ''];

// Set static array
static::$loaded[__METHOD__][$sig] = true;
Expand Down
4 changes: 2 additions & 2 deletions libraries/src/HTML/Helpers/WorkflowStage.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public static function existing($options)
$workflowStages[$workflowStageKey][] = HTMLHelper::_('select.option', $stage->workflow_stage_id, Text::_($stage->workflow_stage_title));
}

$prefix[] = [
$prefix = [[
HTMLHelper::_('select.option', '', $options['title'])
];
]];

return array_merge($prefix, $workflowStages);
}
Expand Down
1 change: 1 addition & 0 deletions libraries/src/Installer/Adapter/ComponentAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ protected function copyBaseFiles()

// If there is a manifest script, let's copy it.
if ($this->manifest_script) {
$path = [];
$path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script;
$path['dest'] = $this->parent->getPath('extension_administrator') . '/' . $this->manifest_script;

Expand Down
3 changes: 3 additions & 0 deletions libraries/src/Installer/Adapter/FileAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ protected function finaliseInstall()
Folder::create($this->parent->getPath('extension_root'));
}

$path = [];
$path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script;
$path['dest'] = $this->parent->getPath('extension_root') . '/' . $this->manifest_script;

Expand Down Expand Up @@ -514,6 +515,7 @@ protected function populateFilesAndFolderList()
if (\count($eFiles->children())) {
// Loop through all filenames elements
foreach ($eFiles->children() as $eFileName) {
$path = [];
$path['src'] = $sourceFolder . '/' . $eFileName;
$path['dest'] = $targetFolder . '/' . $eFileName;
$path['type'] = 'file';
Expand All @@ -530,6 +532,7 @@ protected function populateFilesAndFolderList()
$files = Folder::files($sourceFolder);

foreach ($files as $file) {
$path = [];
$path['src'] = $sourceFolder . '/' . $file;
$path['dest'] = $targetFolder . '/' . $file;

Expand Down
1 change: 1 addition & 0 deletions libraries/src/Installer/Adapter/LibraryAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ protected function finaliseInstall()

// If there is a manifest script, let's copy it.
if ($this->manifest_script) {
$path = [];
$path['src'] = $this->parent->getPath('source') . '/' . $this->manifest_script;
$path['dest'] = $this->parent->getPath('extension_root') . '/' . $this->manifest_script;

Expand Down

0 comments on commit 6fb31c7

Please sign in to comment.