You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The exception comes form an un-guarded check on the zeroth element of the attributesNames list. In this situation, attribute names is empty and so has no zeroth element.
Add guard to .globally() method of HtmlPolicyBuilder to prevent
ArrayOutOfBoundsException when checking to see if the zeroth
element of the attributeNames list contains 'style'.
This restores behaviour present in version 202180219.1 which
allowed for an empty allowed attributes names list to be
specified globally through the builder.
* Fix allowAttributes().globally() (#247)
Add guard to .globally() method of HtmlPolicyBuilder to prevent
ArrayOutOfBoundsException when checking to see if the zeroth
element of the attributeNames list contains 'style'.
This restores behaviour present in version 202180219.1 which
allowed for an empty allowed attributes names list to be
specified globally through the builder.
* Allow styling when any attribute name matches "style" globally
---------
Co-authored-by: Mike Samuel <[email protected]>
Constructing a HtmlPolicyBuilder zero-defined global attributes, globally, leads to an Arry out of bounds exception
Here is sample code that produces the problem
The exception comes form an un-guarded check on the zeroth element of the attributesNames list. In this situation, attribute names is empty and so has no zeroth element.
This construction used to work in version 20180219.1 of this library but is broken in 20211018.2.
The text was updated successfully, but these errors were encountered: