Issue Bug Closed

#90883TypeError "htmlspecialchars() expects parameter 1 to be string, int given" inside ArrayBrowser

Julian Mair 03/30/20, 12:34 updated 04/21/20, 10:42

Description

In the BE Configuration Module, inside “HTTP Middlewares (PSR-15)”, the following error is triggerd, if i open a “after/before” node in the new primary node ‘raw’:

(1/1) TypeError
htmlspecialchars() expects parameter 1 to be string, int given

in /var/www/html/httpdocs/typo3/sysext/backend/Classes/View/ArrayBrowser.php line 115

            if ($isArray && !$this->expAll && $this->route) {
                $goto = 'a' . substr(md5($depth), 0, 6);
                $output .= '<a class="list-tree-control' . ($isExpanded ? ' list-tree-control-open' : ' list-tree-control-closed') . '" id="' . $goto . '" href="' . htmlspecialchars((string)$this->uriBuilder->buildUriFromRoute($this->route->getOption('_identifier'), ['node' => [rawurldecode($depth) => $isExpanded ? 0 : 1]]) . '#' . $goto) . '"><i class="fa"></i></a> ';
            }
            $output .= '<span class="list-tree-label">' . htmlspecialchars($key) . '</span>';
            if (!$isArray) {
                $output .= ' = <span class="list-tree-value">' . htmlspecialchars($value) . '</span>';
            }
            $output .= '</span>';

—-

I’m not really familiar with the core code, but i think a simple string conversion for the $key in `htmlspecialchars($key)` could solve the problem.

Reviews 1