diff --git a/application/cmdbabstract.class.inc.php b/application/cmdbabstract.class.inc.php index 8df5b2765..a15e9601d 100644 --- a/application/cmdbabstract.class.inc.php +++ b/application/cmdbabstract.class.inc.php @@ -754,7 +754,7 @@ HTML $oClassIcon = new MedallionIcon(MetaModel::GetClassIcon($sTargetClass, false)); $oClassIcon->SetDescription($oAttDef->GetDescription())->AddCSSClass('ibo-block-list--medallion'); $oPage->AddUiBlock($oClassIcon); - + $sDisplayValue = ''; // not used $sHTMLValue = "".self::GetFormElementForField($oPage, $sClass, $sAttCode, $oAttDef, $oLinkSet, $sDisplayValue, $sInputId, '', $iFlags, $aArgs).''; @@ -5239,11 +5239,14 @@ EOF } else { $sStatus = $bResult ? Dict::S('UI:BulkModifyStatusModified') : Dict::S('UI:BulkModifyStatusSkipped'); } - $sChecked = $bResult ? 'checked' : ''; + + $aErrorsToDisplay = array_map(function($sError) { + return utils::HtmlEntities($sError); + }, $aErrors); $aRows[] = array( 'object' => $oObj->GetHyperlink(), 'status' => $sStatus, - 'errors' => '
'.($bResult ? '' : implode('
', $aErrors)).'
', + 'errors' => ''.($bResult ? '' : implode('
', $aErrorsToDisplay)).'
', ); if ($bResult && (!$bPreview)) { $oObj->DBUpdate(); @@ -5252,7 +5255,7 @@ EOF set_time_limit(intval($iPreviousTimeLimit)); $oTable = DataTableUIBlockFactory::MakeForForm('BulkModify', $aHeaders, $aRows); $oTable->AddOption("bFullscreen", true); - + $oPanel = PanelUIBlockFactory::MakeForClass($sClass, ''); $oPanel->SetIcon($sClassIcon); $oPanel->SetTitle($sHeaderTitle); @@ -5458,13 +5461,13 @@ EOF $oFailAlertBlock = AlertUIBlockFactory::MakeForDanger('', Dict::S('UI:Delete:SorryDeletionNotAllowed')); $oFailAlertBlock->SetIsClosable(false); $oP->AddUiBlock($oFailAlertBlock); - } + } else { $oWarningAlertBlock = AlertUIBlockFactory::MakeForWarning('', Dict::S('UI:Delete:PleaseDoTheManualOperations')); $oWarningAlertBlock->SetIsClosable(false); $oP->AddUiBlock($oWarningAlertBlock); } - + $oForm = FormUIBlockFactory::MakeStandard(''); $oP->AddSubBlock($oForm); $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden('transaction_id', utils::ReadParam('transaction_id', '', false, 'transaction_id'))); diff --git a/core/dbobject.class.php b/core/dbobject.class.php index 92836a043..d49e31f58 100644 --- a/core/dbobject.class.php +++ b/core/dbobject.class.php @@ -1929,7 +1929,7 @@ abstract class DBObject implements iDisplay /** @var \AttributeExternalKey $oAtt */ $sTargetClass = $oAtt->GetTargetClass(); if (false === MetaModel::IsObjectInDB($sTargetClass, $toCheck)) { - return "Target object not found (".utils::HtmlEntities($sTargetClass).".::".utils::HtmlEntities($toCheck).")"; + return "Target object not found (".$sTargetClass.".::".$toCheck.")"; } } if ($oAtt->IsHierarchicalKey()) @@ -1938,7 +1938,7 @@ abstract class DBObject implements iDisplay $aValues = $oAtt->GetAllowedValues(array('this' => $this)); if (!array_key_exists($toCheck, $aValues)) { - return "Value not allowed [". utils::HtmlEntities($toCheck)."]"; + return "Value not allowed [$toCheck]"; } } } @@ -1952,7 +1952,7 @@ abstract class DBObject implements iDisplay $oTag->SetValues(explode(' ', $toCheck)); } catch (Exception $e) { - return "Tag value [". utils::HtmlEntities($toCheck)."] is not a valid tag list"; + return "Tag value '$toCheck' is not a valid tag list"; } return true; @@ -1980,7 +1980,7 @@ abstract class DBObject implements iDisplay $oTag->SetValues($aValues); } catch (Exception $e) { - return "Set value[". utils::HtmlEntities($toCheck)."] is not a valid set"; + return "Set value '$toCheck' is not a valid set"; } return true; @@ -2000,7 +2000,7 @@ abstract class DBObject implements iDisplay { if (!array_key_exists($toCheck, $aValues)) { - return "Value not allowed [". utils::HtmlEntities($toCheck)."]"; + return "Value not allowed [$toCheck]"; } } if (!is_null($iMaxSize = $oAtt->GetMaxSize())) @@ -2013,7 +2013,7 @@ abstract class DBObject implements iDisplay } if (!$oAtt->CheckFormat($toCheck)) { - return "Wrong format [". utils::HtmlEntities($toCheck)."]"; + return "Wrong format [$toCheck]"; } } else diff --git a/pages/UI.php b/pages/UI.php index 3a658c730..5e6fc6676 100644 --- a/pages/UI.php +++ b/pages/UI.php @@ -1474,7 +1474,10 @@ EOF } else { - $sError = ''.implode('
',$aErrors)."\n"; + $aErrorsToDisplay = array_map(function($sError) { + return utils::HtmlEntities($sError); + }, $aErrors); + $sError = ''.implode('
',$aErrorsToDisplay)."\n"; } } else