Exercise/HTMLPurifierBundle

Scalar check instead is_string

markitosgv opened this issue · 2 comments

Why you're checking if data is scalar instead of string? Purify a boolean or integer value makes no sense, isn't it?

if (!is_scalar($data = $event->getData())) {

The form is not aware of the request format.
Any request handler implementation or custom call to Form::submit can pass something else than a string (think of a FileType that may be submitted some UploadedFile instances from the request).

Only a compound/simple definition matters here, which is resolved by the type extension registering the listener when only extending TextType implementations which are not compound.

I'm closing here for the reason above. I propose to let the discussion continue in #65 instead.
Thanks!