Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions libraries/src/Document/HtmlDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
\defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Cache\Cache;
use Joomla\CMS\Cache\CacheControllerFactoryInterface;
use Joomla\CMS\Factory as CmsFactory;
use Joomla\CMS\Filter\InputFilter;
use Joomla\CMS\Helper\ModuleHelper;
Expand Down Expand Up @@ -559,8 +560,20 @@ public function getBuffer($type = null, $name = null, $attribs = array())
if ($this->_caching == true && $type === 'modules' && $name !== 'debug')
{
/** @var \Joomla\CMS\Document\Renderer\Html\ModulesRenderer $renderer */
$cache = CmsFactory::getCache('com_modules', '');
$hash = md5(serialize(array($name, $attribs, null, get_class($renderer))));
/** @var \Joomla\CMS\Cache\Controller\OutputController $cache */
$cache = CmsFactory::getContainer()->get(CacheControllerFactoryInterface::class)
->createCacheController('output', ['defaultgroup' => 'com_modules']);
$hash = md5(
serialize(
[
$name,
$attribs,
null,
get_class($renderer),
CmsFactory::getApplication()->input->get('Itemid'),
]
)
);
$cbuffer = $cache->get('cbuffer_' . $type);

if (isset($cbuffer[$hash]))
Expand Down