diff --git a/interface/billing/sl_eob_invoice.php b/interface/billing/sl_eob_invoice.php index bab6528accf..74263a45dcc 100644 --- a/interface/billing/sl_eob_invoice.php +++ b/interface/billing/sl_eob_invoice.php @@ -603,8 +603,8 @@ function updateFields(payField, adjField, balField, coPayField, isFirstProcCode) - -   + +   diff --git a/library/js/utility.js b/library/js/utility.js index a47b13cb67d..0de2b8fd7cc 100644 --- a/library/js/utility.js +++ b/library/js/utility.js @@ -26,30 +26,33 @@ function xl(string) { // html escaping functions - special case when sending js string to html (see codebase for examples) // jsText (equivalent to text() ) // jsAttr (equivalent to attr() ) -const htmlEscapesText = { - '&': '&', - '<': '<', - '>': '>' -}; -const htmlEscapesAttr = { - '&': '&', - '<': '<', - '>': '>', - '"': '"', - "'": ''' -}; -const htmlEscaperText = /[&<>]/g; -const htmlEscaperAttr = /[&<>"']/g; -jsText = function(string) { - return ('' + string).replace(htmlEscaperText, function(match) { - return htmlEscapesText[match]; - }); -}; -jsAttr = function(string) { - return ('' + string).replace(htmlEscaperAttr, function(match) { - return htmlEscapesAttr[match]; - }); -}; +// must be careful assigning const in this script. can't reinit a constant +if (typeof htmlEscapesText === 'undefined') { + const htmlEscapesText = { + '&': '&', + '<': '<', + '>': '>' + }; + const htmlEscapesAttr = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + }; + const htmlEscaperText = /[&<>]/g; + const htmlEscaperAttr = /[&<>"']/g; + jsText = function (string) { + return ('' + string).replace(htmlEscaperText, function (match) { + return htmlEscapesText[match]; + }); + }; + jsAttr = function (string) { + return ('' + string).replace(htmlEscaperAttr, function (match) { + return htmlEscapesAttr[match]; + }); + }; +} // another useful function async function syncFetchFile(fileUrl, type = 'text') { @@ -344,7 +347,7 @@ function oeSortable(callBackFn) { }) } -}; +} /* diff --git a/src/OeUI/OemrUI.php b/src/OeUI/OemrUI.php index 537afd0afb8..b198fe9a5a1 100644 --- a/src/OeUI/OemrUI.php +++ b/src/OeUI/OemrUI.php @@ -393,7 +393,7 @@ private function headerExpandJs($arrFiles = array()) private function headerActionJs($arrAction = array()) { $arrAction = $this->arrAction; - $page = str_replace(" ", "", $this->heading); + $page = attr(str_replace(" ", "", $this->heading)); // Build the labels for when the icon is moused-over $labels = "";