N°4517 - PHP 8.1: Replace htmlentities(***, ENT_QUOTES, 'UTF-8') with utils::EscapeHtml

This commit is contained in:
acognet
2022-07-01 09:22:25 +02:00
parent 139be3a9b7
commit 7ec12f1e12
54 changed files with 446 additions and 589 deletions

View File

@@ -1235,12 +1235,12 @@ class ObjectController extends BrickController
$oAttachment->Set('contents', $oDocument);
$iAttId = $oAttachment->DBInsert();
$aData['msg'] = htmlentities($oDocument->GetFileName(), ENT_QUOTES, 'UTF-8');
$aData['msg'] = utils::EscapeHtml($oDocument->GetFileName());
$aData['icon'] = utils::GetAbsoluteUrlAppRoot().'env-'.utils::GetCurrentEnvironment().'/itop-attachments/icons/icons8-image-file.svg';
// Checking if the instance has attachments
if (class_exists('AttachmentPlugIn')) {
$aData['icon'] = utils::GetAbsoluteUrlAppRoot() . AttachmentPlugIn::GetFileIcon($oDocument->GetFileName());
$aData['icon'] = utils::GetAbsoluteUrlAppRoot().AttachmentPlugIn::GetFileIcon($oDocument->GetFileName());
}
$aData['att_id'] = $iAttId;

View File

@@ -324,10 +324,9 @@ class ApplicationHelper
if (substr($sFieldsetName, 0, 1) !== '_')
{
$sFieldsetHTML = "\t\t<fieldset>\n";
$sFieldsetHTML .= "\t\t\t<legend>".htmlentities(Dict::S($sFieldsetName), ENT_QUOTES, 'UTF-8')."</legend>\n";
$sFieldsetHTML .= "\t\t\t<legend>".utils::EscapeHtml(Dict::S($sFieldsetName))."</legend>\n";
foreach ($aAttCodes as $sAttCode)
{
foreach ($aAttCodes as $sAttCode) {
$sFieldsetHTML .= "\t\t\t<div class=\"form_field\" data-field-id=\"".$sAttCode."\"></div>\n";
}