mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-07 17:42:53 +01:00
Fix dol_escape_htmltag to prevent bad strip of char (#29931)
Co-authored-by: Hystepik <lmarcouiller@nltechno.com>
This commit is contained in:
committed by
GitHub
parent
61c9245498
commit
d63687da6d
@@ -1119,6 +1119,10 @@ class FunctionsLibTest extends CommonClassTest
|
||||
$input = 'x&<b>#</b>,"'; // & and " are converted into html entities, <b> are not removed
|
||||
$result = dol_escape_htmltag($input, 1);
|
||||
$this->assertEquals('x&<b>#</b>,"', $result);
|
||||
|
||||
$input = '<img alt="" src="https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png">'; // & and " are converted into html entities, <b> are not removed
|
||||
$result = dol_escape_htmltag($input, 1, 1, 'common', 0, 1);
|
||||
$this->assertEquals('<img alt="" src="https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png">', $result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user