diff --git a/ihtml/themes/breezy/simpleplugin_section.tpl b/ihtml/themes/breezy/simpleplugin_section.tpl index 03834100b07eca671414cb1cc2730d53d390819c..ce065e76ae595ab73b7713abfe55080ad4c8b4d2 100644 --- a/ihtml/themes/breezy/simpleplugin_section.tpl +++ b/ihtml/themes/breezy/simpleplugin_section.tpl @@ -1,5 +1,5 @@ <fieldset id="{$sectionId}" class="plugin-section{$sectionClasses}"> - <legend><span>{$section|escape}</span></legend> + <legend><span>{if $sectionIcon}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape}</span></legend> <div> <table> {foreach from=$attributes item=attribute key=id} diff --git a/include/class_objects.inc b/include/class_objects.inc index 590dd34cf325672a563ab2305e609b1a2767e1d3..68b1b679576ecf49cd9fca2199606dc994d674de 100644 --- a/include/class_objects.inc +++ b/include/class_objects.inc @@ -380,7 +380,7 @@ class objects $text = htmlescape($text); if ($icon && isset($infos['icon'])) { - $text = '<img alt="'.$infos['name'].'" title="'.$dn.'" src="'.htmlescape($infos['icon']).'" class="center"/> '.$text; + $text = '<img alt="'.htmlescape($infos['name']).'" title="'.htmlescape($dn).'" src="'.htmlescape($infos['icon']).'" class="center"/> '.$text; } if ($link) { diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index 3beb1508157fea88b0c2e7cb910fb78e6cd658c7..c4b097455063e1763248152ec3b9d4d7507af487 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -686,7 +686,7 @@ class simplePlugin implements SimpleTab } } elseif (!$this->is_account) { $plInfo = pluglist::pluginInfos(get_class($this)); - $this->header = '<img alt="'._('Error').'" src="geticon.php?context=status&icon=dialog-error&size=16" align="middle"/> <b>'. + $this->header = '<img alt="'.htmlescape(_('Error')).'" src="geticon.php?context=status&icon=dialog-error&size=16" align="middle"/> <b>'. msgPool::noValidExtension($plInfo['plShortName'])."</b>"; $this->displayPlugin = FALSE; return $this->header.$this->inheritanceDisplay(); @@ -875,15 +875,9 @@ class simplePlugin implements SimpleTab $sections = []; foreach ($this->attributesInfo as $section => $sectionInfo) { - $legend = $sectionInfo['name']; - if (isset($sectionInfo['icon'])) { - $legend = '<img '. - 'src="'.htmlescape($sectionInfo['icon']).'" '. - 'alt="" '. - '/>'.$legend; - } - $smarty->assign("section", $legend); - $smarty->assign("sectionId", $section); + $smarty->assign('section', $sectionInfo['name']); + $smarty->assign('sectionIcon', ($sectionInfo['icon'] ?? NULL)); + $smarty->assign('sectionId', $section); $sectionClasses = ''; if (isset($sectionInfo['class'])) { $sectionClasses .= ' '.join(' ', $sectionInfo['class']); diff --git a/include/simpleplugin/class_simpleTabs.inc b/include/simpleplugin/class_simpleTabs.inc index cae6e71482e451a701a2770acf87681c4d7fa219..0a83ea57959c23cac2c9def7c5c38e7ca3a2a409 100644 --- a/include/simpleplugin/class_simpleTabs.inc +++ b/include/simpleplugin/class_simpleTabs.inc @@ -283,9 +283,6 @@ class simpleTabs $title = mb_substr($title, 0, 25, 'UTF-8')."..."; } - /* nobr causes w3c warnings so we use to keep the tab name in one line */ - $title = str_replace(' ', ' ', $title); - $cssClasses = $style[$index]; /* Take care about notifications */ diff --git a/plugins/addons/dashboard/groups_stats.tpl b/plugins/addons/dashboard/groups_stats.tpl index f4afd84428a1bec8cfb306440b679dcca6f129c3..f3150102aade6bf618072ee482a9c9ac5882e7e2 100644 --- a/plugins/addons/dashboard/groups_stats.tpl +++ b/plugins/addons/dashboard/groups_stats.tpl @@ -1,6 +1,6 @@ <div id="{$sectionId}" class="plugin-section"> <span class="legend"> - {$section|escape} + {if $sectionIcon}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} </span> <div> <img src="{$attributes.groups_stats.img|escape}" alt="group icon"/> diff --git a/plugins/addons/dashboard/pwd_stats.tpl b/plugins/addons/dashboard/pwd_stats.tpl index a5bc5e843f945d8a49bf4efff1cfddd671fc4c4c..2beb83ec302afe50ca1a6ce1d66fafa425a1e4a0 100644 --- a/plugins/addons/dashboard/pwd_stats.tpl +++ b/plugins/addons/dashboard/pwd_stats.tpl @@ -1,6 +1,6 @@ <div id="{$sectionId}" class="plugin-section"> <span class="legend"> - {$section|escape} + {if $sectionIcon}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} </span> <div> <img src="{$attributes.pwds_stats.img|escape}" alt="user icon"/> diff --git a/plugins/addons/dashboard/users_accounts.tpl b/plugins/addons/dashboard/users_accounts.tpl index 8c9463be82600bc81c520e61e2bd1346e12b17bc..8be66f49e53ece0e18115c23343f0f96da80e7b4 100644 --- a/plugins/addons/dashboard/users_accounts.tpl +++ b/plugins/addons/dashboard/users_accounts.tpl @@ -1,6 +1,6 @@ <div id="{$sectionId}" class="plugin-section fullwidth"> <span class="legend"> - {$section|escape} + {if $sectionIcon}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} </span> <div> <h1> diff --git a/plugins/addons/dashboard/users_stats.tpl b/plugins/addons/dashboard/users_stats.tpl index 3577f84a802b22b8a7e546cc6378869c03b0b8e6..c6797eef6ccbec033772026826ed1a87d2b507ad 100644 --- a/plugins/addons/dashboard/users_stats.tpl +++ b/plugins/addons/dashboard/users_stats.tpl @@ -1,6 +1,6 @@ <div id="{$sectionId}" class="plugin-section"> <span class="legend"> - {$section|escape} + {if $sectionIcon}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} </span> <div> <img src="{$attributes.users_stats.img|escape}" alt="user icon"/> diff --git a/plugins/generic/references/contents.tpl b/plugins/generic/references/contents.tpl index 0a4234c790300e5f4209c80f2386e7b69ad270f2..eaf31cc3bc56af148b791d57138317b3428dc581 100644 --- a/plugins/generic/references/contents.tpl +++ b/plugins/generic/references/contents.tpl @@ -1,6 +1,6 @@ <div id="{$sectionId}" class="plugin-section{$sectionClasses}"> <span class="legend"> - {$section|escape} + {if $sectionIcon}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} </span> <div> {if $attributes.refs} diff --git a/setup/setup_checks.tpl b/setup/setup_checks.tpl index 80776db1c243919eb69e191e9c62e2353ef1bdf7..8dccadf0c112132ecce84d321c0cd8d2cecc9799 100644 --- a/setup/setup_checks.tpl +++ b/setup/setup_checks.tpl @@ -1,6 +1,6 @@ <div id="{$sectionId}" class="plugin-section"> <span class="legend"> - {$section} + {if $sectionIcon}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} </span> <div> {foreach from=$attributes item=infos} diff --git a/setup/setup_migrate.tpl b/setup/setup_migrate.tpl index 346595123a707c7d598b5513d5283c4f38eb940f..8072f33bbae936e5eee924951d89ea65f0305bcd 100644 --- a/setup/setup_migrate.tpl +++ b/setup/setup_migrate.tpl @@ -1,6 +1,6 @@ <div id="{$sectionId}" class="plugin-section{$sectionClasses}"> <span class="legend"> - {$section} + {if $sectionIcon}<img src="{$sectionIcon|escape}" alt=""/>{/if}{$section|escape} </span> <div> {foreach from=$attributes item=checks}