mirror of
https://github.com/Znote/ZnoteAAC.git
synced 2025-10-13 18:04:54 +02:00
html-encode dynamic values in buypoints.php (#364)
* add html encoding function * html-encode dynamic values important if the values contain special characters like '&<>" (for example if $config['site_title'] is `AT&T` or `<AWESOMESERVER>`, the old code would generate invalid html, but this updated code will generate valid html.)
This commit is contained in:

committed by
Stefan A. Brannfjell

parent
53dbc9fdd7
commit
01c5da322a
@@ -559,5 +559,9 @@ function verifyGoogleReCaptcha($postResponse = null) {
|
||||
$json = json_decode($response);
|
||||
return isset($json->success) && $json->success;
|
||||
}
|
||||
// html encoding function (encode any string to valid UTF-8 HTML)
|
||||
function hhb_tohtml(/*string*/ $str)/*:string*/ {
|
||||
return htmlentities($str, ENT_QUOTES | ENT_HTML401 | ENT_SUBSTITUTE | ENT_DISALLOWED, 'UTF-8', true);
|
||||
}
|
||||
|
||||
?>
|
||||
|
Reference in New Issue
Block a user