1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 10:04:35 +02:00

e_parse::toAttributes(): New API to concatenate HTML attributes

`e_parse::toAttributes()` is an expansion of the formerly private method
`e_form::attributes()`. Now, all client code can use
`e_parse::toAttributes()` to make it easy to concatenate variable-length
HTML attributes. Values are guaranteed to be encoded so that they cannot
escape an HTML attribute value.

All client code usages are encouraged to build HTML tags with this new
method to prevent cross-site scripting (XSS) attacks and prevent
breaking the HTML validity due to improperly escaped HTML attributes.

This new method is an extension to `e_parse::toAttribute()`, which
escaped one single HTML attribute value.
This commit is contained in:
Nick Liu
2022-02-06 16:49:56 +01:00
parent 2097778cc5
commit 169efa09b9
3 changed files with 3220 additions and 3088 deletions

File diff suppressed because it is too large Load Diff