diff --git a/application/forms.class.inc.php b/application/forms.class.inc.php index bec82cab4..a2cee1598 100644 --- a/application/forms.class.inc.php +++ b/application/forms.class.inc.php @@ -1450,8 +1450,8 @@ class DesignerHiddenField extends DesignerFormField { $sId = $this->oForm->GetFieldId($this->sCode); $sName = $this->oForm->GetFieldName($this->sCode); - $sChecked = $this->defaultValue ? 'checked' : ''; - return array('label' =>'', 'value' => "defaultValue, ENT_QUOTES, 'UTF-8')."\">"); + + return array('label' => '', 'value' => "defaultValue)."\">"); } } diff --git a/application/utils.inc.php b/application/utils.inc.php index 53779cb53..cf972a9b7 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -1843,7 +1843,7 @@ class utils public static function EscapeHtml($sValue) { return htmlspecialchars( - $sValue, + $sValue ?? '', ENT_QUOTES | ENT_DISALLOWED | ENT_HTML5, WebPage::PAGES_CHARSET, false diff --git a/webservices/export-v2.php b/webservices/export-v2.php index 1c76922c6..0bd25cb6b 100644 --- a/webservices/export-v2.php +++ b/webservices/export-v2.php @@ -134,7 +134,7 @@ function DisplayExpressionForm(WebPage $oP, $sAction, $sExpression = '', $sExcep $oPanel->AddSubBlock(InputUIBlockFactory::MakeForHidden('interactive', '1')); $oFieldQuery = FieldUIBlockFactory::MakeStandard(''); - $oTextArea = new TextArea('expression', htmlentities($sExpression, ENT_QUOTES, 'UTF-8'), "textarea_oql", 70, 8); + $oTextArea = new TextArea('expression', utils::EscapeHtml($sExpression), "textarea_oql", 70, 8); $oTextArea->SetPlaceholder(Dict::S('Core:BulkExportQueryPlaceholder')); $oTextArea->AddCSSClasses(["ibo-input-text", "ibo-query-oql", "ibo-is-code"]); $oFieldQuery->AddSubBlock($oTextArea); @@ -267,14 +267,14 @@ EOF } if ($sExpression !== '') { - $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden("expression", htmlentities($sExpression, ENT_QUOTES, 'UTF-8'))); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden("expression", utils::EscapeHtml($sExpression))); $oExportSearch = DBObjectSearch::FromOQL($sExpression); $oExportSearch->UpdateContextFromUser(); } else { $oQuery = MetaModel::GetObject('QueryOQL', $sQueryId); $oExportSearch = DBObjectSearch::FromOQL($oQuery->Get('oql')); $oExportSearch->UpdateContextFromUser(); - $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden("query", htmlentities($sQueryId, ENT_QUOTES, 'UTF-8'))); + $oForm->AddSubBlock(InputUIBlockFactory::MakeForHidden("query", utils::EscapeHtml($sQueryId))); } $aFormPartsByFormat = array(); $aAllFormParts = array(); @@ -302,7 +302,7 @@ EOF } else { // One specific format was chosen - $oSelect = InputUIBlockFactory::MakeForHidden("format", htmlentities($sFormat, ENT_QUOTES, 'UTF-8')); + $oSelect = InputUIBlockFactory::MakeForHidden("format", utils::EscapeHtml($sFormat)); $oForm->AddSubBlock($oSelect); $oExporter = BulkExport::FindExporter($sFormat, $oExportSearch); @@ -362,7 +362,7 @@ function InteractiveShell($sExpression, $sQueryId, $sFormat, $sFileName, $sMode) { if ($sMode == 'dialog') { $sExportBtnLabel = json_encode(Dict::S('UI:Button:Export')); - $sJSTitle = json_encode(htmlentities(utils::ReadParam('dialog_title', '', false, 'raw_data'), ENT_QUOTES, 'UTF-8')); + $sJSTitle = json_encode(utils::EscapeHtml(utils::ReadParam('dialog_title', '', false, 'raw_data'))); $oP = new AjaxPage($sJSTitle); $oP->add('