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 (joomla#36794)

* [3.10] [PHP 8.1] Make templates/system/html/modules.php PHP 8.1 compatible

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)

* [3.10] [PHP 8.1] Fixes protostar modules.php null string param

Fixes `Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/beat/www/j/templates/protostar/html/modules.php on line 47`

* [3.10] [PHP 8.1] Fixes beez modules.php null string param

Fixes errors like `Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in templates/beez/html/modules.php on line 42`
  • Loading branch information
beat authored Jan 23, 2022
1 parent e02d637 commit 61396f7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions templates/beez3/html/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function modChrome_beezDivision($module, &$params, &$attribs)
{
$headerLevel = isset($attribs['headerLevel']) ? (int) $attribs['headerLevel'] : 3;
if (!empty ($module->content)) : ?>
<div class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); ?>">
<div class="moduletable<?php echo htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8'); ?>">
<?php if ($module->showtitle) : ?>
<h<?php echo $headerLevel; ?>><?php echo $module->title; ?></h<?php echo $headerLevel; ?>>
<?php endif; ?>
Expand All @@ -39,7 +39,7 @@ function modChrome_beezHide($module, &$params, &$attribs)
if (!empty ($module->content)) { ?>

<div
class="moduletable_js <?php echo htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');?>"><?php if ($module->showtitle) : ?>
class="moduletable_js <?php echo htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');?>"><?php if ($module->showtitle) : ?>
<h<?php echo $headerLevel; ?> class="js_heading"> <?php echo $module->title; ?> <a href="#"
title="<?php echo JText::_('TPL_BEEZ3_CLICK'); ?>"
onclick="auf('module_<?php echo $module->id; ?>'); return false"
Expand Down
2 changes: 1 addition & 1 deletion templates/protostar/html/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function modChrome_well($module, &$params, &$attribs)

if ($module->content)
{
echo '<' . $moduleTag . ' class="well ' . htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8') . $moduleClass . '">';
echo '<' . $moduleTag . ' class="well ' . htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8') . $moduleClass . '">';

if ($module->showtitle)
{
Expand Down
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 61396f7

Please sign in to comment.