Skip to content

Commit

Permalink
[3.10] [PHP 8.1] fixes all modules Deprecated: htmlspecialchars(): Pa…
Browse files Browse the repository at this point in the history
…ssing null to type string (#36795)

* [3.10] [PHP 8.1] fixes mod_tags_popular

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

* [3.10] [PHP 8.1] fixes mod_breadcrumbs

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

* Update mod_custom.php

Fixes `Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in modules/mod_custom/mod_custom.php on line 18`

* [3.10] [PHP 8.1] Fixes mod_menu.php

Fixes `Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in modules/mod_menu/mod_menu.php on line 23`

* [3.10] [PHP 8.1] mod_stats

* [3.10] [PHP 8.1] fixes mod_articles_archive.php

* [3.10] [PHP 8.1] mod_articles_categories.php

* [3.10] [PHP 8.1] fixes mod_articles_category

* [3.10] [PHP 8.1] fixes mod_articles_latest

* [3.10] [PHP 8.1] fixes mod_articles_news

* [3.10] [PHP 8.1] fixes mod_articles_popular

* [3.10] [PHP 8.1] fixes mod_banners

* [3.10] [PHP 8.1] fixes mod_feed

* [3.10] [PHP 8.1] fixes mod_footer

* [3.10] [PHP 8.1] fixes mod_languages

* [3.10] [PHP 8.1] fixes mod_random_image

* [3.10] [PHP 8.1] fixes mod_related_items

* [3.10] [PHP 8.1] fixes mod_syndicate

* [3.10] [PHP 8.1] fixes mod_tags_similar

* [3.10] [PHP 8.1] fixes mod_users_latest

* [3.10] [PHP 8.1] fixes mod_whosonline

* [3.10] [PHP 8.1] fixes mod_wrapper

* [3.10] [PHP 8.1] fixes admin mod_privacy_dashboard

* [3.10] [PHP 8.1] fixes admin mod_feed

* [3.10] [PHP 8.1] fixes admin mod_stats_admin
  • Loading branch information
beat authored Jan 23, 2022
1 parent c7cf2dc commit e02d637
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion administrator/modules/mod_feed/mod_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
}

$feed = ModFeedHelper::getFeed($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_feed', $params->get('layout', 'default'));
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
JLoader::register('ModPrivacyDashboardHelper', __DIR__ . '/helper.php');

$list = ModPrivacyDashboardHelper::getData();
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_privacy_dashboard', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion administrator/modules/mod_stats_admin/mod_stats_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
$serverinfo = $params->get('serverinfo');
$siteinfo = $params->get('siteinfo');
$list = ModStatsHelper::getStats($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_stats_admin', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_articles_archive/mod_articles_archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
JLoader::register('ModArchiveHelper', __DIR__ . '/helper.php');

$params->def('count', 10);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
$list = ModArchiveHelper::getList($params);

require JModuleHelper::getLayoutPath('mod_articles_archive', $params->get('layout', 'default'));
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

if (!empty($list))
{
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
$startLevel = reset($list)->getParent()->level;

require JModuleHelper::getLayoutPath('mod_articles_categories', $params->get('layout', 'default'));
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_articles_category/mod_articles_category.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
$grouped = false;
$article_grouping = $params->get('article_grouping', 'none');
$article_grouping_direction = $params->get('article_grouping_direction', 'ksort');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
$item_heading = $params->get('item_heading');

if ($article_grouping !== 'none')
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_articles_latest/mod_articles_latest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
JLoader::register('ModArticlesLatestHelper', __DIR__ . '/helper.php');

$list = ModArticlesLatestHelper::getList($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_articles_latest', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_articles_news/mod_articles_news.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
JLoader::register('ModArticlesNewsHelper', __DIR__ . '/helper.php');

$list = ModArticlesNewsHelper::getList($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_articles_news', $params->get('layout', 'horizontal'));
2 changes: 1 addition & 1 deletion modules/mod_articles_popular/mod_articles_popular.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
JLoader::register('ModArticlesPopularHelper', __DIR__ . '/helper.php');

$list = ModArticlesPopularHelper::getList($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_articles_popular', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_banners/mod_banners.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
JLoader::register('BannersHelper', JPATH_ADMINISTRATOR . '/components/com_banners/helpers/banners.php');
BannersHelper::updateReset();
$list = &ModBannersHelper::getList($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_banners', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_breadcrumbs/mod_breadcrumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

// Set the default separator
$separator = ModBreadCrumbsHelper::setSeparator($params->get('separator'));
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_breadcrumbs', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_custom/mod_custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
$module->content = JHtml::_('content.prepare', $module->content, '', 'mod_custom.content');
}

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_custom', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_feed/mod_feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
}

$feed = ModFeedHelper::getFeed($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_feed', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_footer/mod_footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
$lineone = $line1;
}

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_footer', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_languages/mod_languages.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
$headerText = $params->get('header_text');
$footerText = $params->get('footer_text');
$list = ModLanguagesHelper::getList($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_languages', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_menu/mod_menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
$default_id = $default->id;
$path = $base->tree;
$showAll = $params->get('showAllChildren', 1);
$class_sfx = htmlspecialchars($params->get('class_sfx'), ENT_COMPAT, 'UTF-8');
$class_sfx = htmlspecialchars($params->get('class_sfx', ''), ENT_COMPAT, 'UTF-8');

if (count($list))
{
Expand Down
2 changes: 1 addition & 1 deletion modules/mod_random_image/mod_random_image.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
}

$image = ModRandomImageHelper::getRandomImage($params, $images);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_random_image', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_related_items/mod_related_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
return;
}

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
$showDate = $params->get('showDate', 0);

require JModuleHelper::getLayoutPath('mod_related_items', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_stats/mod_stats.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
$serverinfo = $params->get('serverinfo', 0);
$siteinfo = $params->get('siteinfo', 0);
$list = ModStatsHelper::getList($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_stats', $params->get('layout', 'default'));
4 changes: 2 additions & 2 deletions modules/mod_syndicate/mod_syndicate.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
return;
}

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$text = htmlspecialchars($params->get('text'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
$text = htmlspecialchars($params->get('text', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_syndicate', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_tags_popular/mod_tags_popular.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
return;
}

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
$display_count = $params->get('display_count', 0);

require JModuleHelper::getLayoutPath('mod_tags_popular', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_tags_similar/mod_tags_similar.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
return;
}

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_tags_similar', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_users_latest/mod_users_latest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@

$shownumber = $params->get('shownumber', 5);
$names = ModUsersLatestHelper::getUsers($params);
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_users_latest', $params->get('layout', 'default'));
2 changes: 1 addition & 1 deletion modules/mod_whosonline/mod_whosonline.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
$names = ModWhosonlineHelper::getOnlineUserNames($params);
}

$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');

require JModuleHelper::getLayoutPath('mod_whosonline', $params->get('layout', 'default'));
14 changes: 7 additions & 7 deletions modules/mod_wrapper/mod_wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
$params = ModWrapperHelper::getParams($params);

$load = $params->get('load');
$url = htmlspecialchars($params->get('url'), ENT_COMPAT, 'UTF-8');
$target = htmlspecialchars($params->get('target'), ENT_COMPAT, 'UTF-8');
$width = htmlspecialchars($params->get('width'), ENT_COMPAT, 'UTF-8');
$height = htmlspecialchars($params->get('height'), ENT_COMPAT, 'UTF-8');
$scroll = htmlspecialchars($params->get('scrolling'), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8');
$frameborder = htmlspecialchars($params->get('frameborder'), ENT_COMPAT, 'UTF-8');
$url = htmlspecialchars($params->get('url', ''), ENT_COMPAT, 'UTF-8');
$target = htmlspecialchars($params->get('target', ''), ENT_COMPAT, 'UTF-8');
$width = htmlspecialchars($params->get('width', ''), ENT_COMPAT, 'UTF-8');
$height = htmlspecialchars($params->get('height', ''), ENT_COMPAT, 'UTF-8');
$scroll = htmlspecialchars($params->get('scrolling', ''), ENT_COMPAT, 'UTF-8');
$moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx', ''), ENT_COMPAT, 'UTF-8');
$frameborder = htmlspecialchars($params->get('frameborder', ''), ENT_COMPAT, 'UTF-8');
$ititle = $module->title;
$id = $module->id;

Expand Down

0 comments on commit e02d637

Please sign in to comment.