Skip to content

Commit

Permalink
[3.10] [PHP 8.1] Make templates/system/html/modules.php PHP 8.1 compa…
Browse files Browse the repository at this point in the history
…tible

Fixes `Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/beat/www/j/templates/system/html/modules.php on line 101` and a few more (line 35, line 53, line 115)
  • Loading branch information
beat authored Jan 22, 2022
1 parent b2206b0 commit a5444d7
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/system/html/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function modChrome_html5($module, &$params, &$attribs)
$headerClass = !empty($headerClass) ? ' class="' . htmlspecialchars($headerClass, ENT_COMPAT, 'UTF-8') . '"' : '';

if (!empty ($module->content)) : ?>
<<?php echo $moduleTag; ?> class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8') . $moduleClass; ?>">
<<?php echo $moduleTag; ?> class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8') . $moduleClass; ?>">

<?php if ((bool) $module->showtitle) :?>
<<?php echo $headerTag . $headerClass . '>' . $module->title; ?></<?php echo $headerTag; ?>>
Expand All @@ -50,7 +50,7 @@ function modChrome_html5($module, &$params, &$attribs)
*/
function modChrome_table($module, &$params, &$attribs)
{ ?>
<table cellpadding="0" cellspacing="0" class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); ?>">
<table cellpadding="0" cellspacing="0" class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8'); ?>">
<?php if ((bool) $module->showtitle) : ?>
<tr>
<th>
Expand Down Expand Up @@ -98,7 +98,7 @@ function modChrome_xhtml($module, &$params, &$attribs)
$headerClass = $headerClass ? ' class="' . htmlspecialchars($headerClass, ENT_COMPAT, 'UTF-8') . '"' : '';

if (!empty ($module->content)) : ?>
<<?php echo $moduleTag; ?> class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8') . $moduleClass; ?>">
<<?php echo $moduleTag; ?> class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8') . $moduleClass; ?>">
<?php if ((bool) $module->showtitle) : ?>
<<?php echo $headerTag . $headerClass . '>' . $module->title; ?></<?php echo $headerTag; ?>>
<?php endif; ?>
Expand All @@ -112,7 +112,7 @@ function modChrome_xhtml($module, &$params, &$attribs)
*/
function modChrome_rounded($module, &$params, &$attribs)
{ ?>
<div class="module<?php echo htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); ?>">
<div class="module<?php echo htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8'); ?>">
<div>
<div>
<div>
Expand Down

0 comments on commit a5444d7

Please sign in to comment.