No Code Attached Yet
avatar joomshopping
joomshopping
20 Oct 2025

In Joomla 6 there is a bug in in Joomla\Input\Input

public function getArray..

My test Code:
$app = Factory::getApplication();
print_r($app->input->get->getArray());

URL in browser:
../administrator/index.php?option=com_test&a[attributes]=attributes

An error has occurred.
0 Joomla\Filter\InputFilter::cleanAttributes(): Argument #1 ($attrSet) must be of type array, string given, called in C:\OSPanel\home\j6\libraries\vendor\joomla\filter\src\InputFilter.php on line 248

Call Stack

| Function | Location

-- | -- | --
1 | () | JROOT\libraries\vendor\joomla\filter\src\InputFilter.php:527
2 | Joomla\Filter\InputFilter->cleanAttributes() | JROOT\libraries\vendor\joomla\filter\src\InputFilter.php:248
3 | Joomla\Filter\InputFilter->clean() | JROOT\libraries\vendor\joomla\input\src\Input.php:204
4 | Joomla\Input\Input->getArray() | JROOT\libraries\vendor\joomla\input\src\Input.php:196
5 | Joomla\Input\Input->getArray()

avatar joomshopping joomshopping - open - 20 Oct 2025
avatar joomla-cms-bot joomla-cms-bot - change - 20 Oct 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Oct 2025
avatar joomshopping
joomshopping - comment - 22 Oct 2025

The situation is even worse

My test Code:
$app = Factory::getApplication();
print_r($app->input->get->getArray());

URL in browser:
../administrator/index.php?option=com_test&a=int

Result:
Array ( [option] => com_test [a] => 0 )

URL in browser:
../administrator/index.php?option=com_test&a=bool

Result:
Array ( [option] => com_test [a] => 1 )

URL in browser:
../administrator/index.php?option=com_test&a=attributes

An error has occurred.

0 Joomla\Filter\InputFilter::cleanAttributes(): Argument #1 ($attrSet) must be of type array, string given, called in C:\OSPanel\home\j6\libraries\vendor\joomla\filter\src\InputFilter.php on line 248


Joomla 5 code
protected function getArrayRecursive(array $vars = [], $datasource = null, $defaultFilter = 'unknown', $recursion = false)
{
if (empty($vars) && \is_null($datasource)) {
$vars = $this->data;
} else {
if (!$recursion) {
$defaultFilter = null;
}
}

    $results = [];

    foreach ($vars as $k => $v) {
        if (\is_array($v)) {
            if (\is_null($datasource)) {
                $results[$k] = $this->getArrayRecursive($v, $this->get($k, null, 'array'), $defaultFilter, true);
            } else {
                $results[$k] = $this->getArrayRecursive($v, $datasource[$k], $defaultFilter, true);
            }
        } else {
            $filter = $defaultFilter ?? $v;

            if (\is_null($datasource)) {
                $results[$k] = $this->get($k, null, $filter);
            } elseif (isset($datasource[$k])) {
                $results[$k] = $this->filter->clean($datasource[$k], $filter);
            } else {
                $results[$k] = $this->filter->clean(null, $filter);
            }
        }
    }

    return $results;
}

Joomla 6 code

public function getArray(array $vars = [], $datasource = null)
{
if (empty($vars) && $datasource === null) {
$vars = $this->data;
}

    $results = [];

    foreach ($vars as $k => $v) {
        if (\is_array($v)) {
            if ($datasource === null) {
                $results[$k] = $this->getArray($v, $this->get($k, null, 'array'));
            } else {
                $results[$k] = $this->getArray($v, $datasource[$k]);
            }
        } else {
            if ($datasource === null) {
                $results[$k] = $this->get($k, null, $v);
            } elseif (isset($datasource[$k])) {
                $results[$k] = $this->filter->clean($datasource[$k], $v);
            } else {
                $results[$k] = $this->filter->clean(null, $v);
            }
        }
    }

    return $results;
}

Bug in code

$results[$k] = $this->get($k, null, $filter);

changed to:

$results[$k] = $this->get($k, null, $v);

avatar joomshopping joomshopping - change - 25 Oct 2025
Title
J6 Joomla\Filter\InputFilter::cleanAttributes(): Argument #1 ($attrSet) must be of type array, string given
J6 Bug in $app->input->get->getArray()
avatar joomshopping joomshopping - edited - 25 Oct 2025
avatar ryandemmer
ryandemmer - comment - 23 Jan 2026

Joomla 6 switched to using the framework Joomla\Input\Input implementation in place of the CMS input handling used in earlier versions.

This change exposed an issue in Input::getArray() when called without an explicit filter map. In this case, request values can be misinterpreted as filter names, leading to unexpected filtering behaviour and, in some cases, fatal errors (e.g. when values such as attributes are present).

avatar ryandemmer
ryandemmer - comment - 23 Jan 2026

The easiest fix might be to bring Joomla\CMS\Input\Input::getArray() and Joomla\CMS\Input\Input::getArrayRecursive() over to the framework.

Add a Comment

Login with GitHub to post a comment