Skip to content

Commit 11dd5c0

Browse files
[5.4] PHP8.5 deprecated code (joomla#46134)
* PHP8.5 deprecated * Update HtmlDocument.php --------- Co-authored-by: Tuan Pham Ngoc <[email protected]>
1 parent d48299e commit 11dd5c0

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

libraries/src/Document/HtmlDocument.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,8 @@ public function getBuffer($type = null, $name = null, $attribs = [])
528528
return parent::$_buffer;
529529
}
530530

531-
$title = $attribs['title'] ?? null;
531+
$name ??= '';
532+
$title = $attribs['title'] ?? '';
532533

533534
if (isset(parent::$_buffer[$type][$name][$title])) {
534535
return parent::$_buffer[$type][$name][$title];
@@ -558,12 +559,14 @@ public function getBuffer($type = null, $name = null, $attribs = [])
558559
return Cache::getWorkarounds($cbuffer[$hash], ['mergehead' => 1]);
559560
}
560561

561-
$options = [];
562-
$options['nopathway'] = 1;
563-
$options['nomodules'] = 1;
564-
$options['modulemode'] = 1;
562+
$options = [
563+
'nopathway' => 1,
564+
'nomodules' => 1,
565+
'modulemode' => 1,
566+
];
565567

566568
$this->setBuffer($renderer->render($name, $attribs, null), $type, $name);
569+
567570
$data = parent::$_buffer[$type][$name][$title];
568571

569572
$tmpdata = Cache::setWorkarounds($data, $options);

0 commit comments

Comments
 (0)