No Code Attached Yet
avatar leichtling
leichtling
20 Jan 2026

Steps to reproduce the issue

version 5.4.2

Add the 'format=%27' parameter to the URL of any existing article. For example index.php?option=com_content&view=article&id=111&format=%27

Expected result

Joomla returns 404 and displays an error page from the current template

Actual result

Joomla returns HTTP 500 and displays default error page .

System information (as much as possible)

The parameter 'format' will contain empty string after cleaning input parameters. It will be used for determination of the page type. Since it is empty, an instance of Joomla\CMS\Document will be created instead of its successor (HtmlDocument, JsonDocument, ...). The Document::$_type will not be set and it will be null by default. The exception will be raised on attempt to find a view for undefined (empty) page type. The ExceptionHandler::render will try to get a current output format by a call to Factory::$document->getType() at line 117, which will return null. At the next step $format will be pass to AbstractRenderer::getRenderer($format), which requires a parameter of string type only. The TypeError will be raised here.

This may be fixed quickly by changing the default value for Document::$_type from null to empty string. The method AbstractRenderer::getRenderer($format) will raise InvalidArgumentException in this case. The exception will be processed and the html renderer will be created.

Additional comments

avatar leichtling leichtling - open - 20 Jan 2026
avatar joomla-cms-bot joomla-cms-bot - labeled - 20 Jan 2026
avatar joomla-cms-bot joomla-cms-bot - change - 20 Jan 2026
Labels Added: No Code Attached Yet

Add a Comment

Login with GitHub to post a comment