I may be wrong, but I think that both items you highlighted we should not "cleanstring" since it will change the content, and we do not want to change the content. The cleanString is supposed to be mainly on "name" part of the attribute, not on the "value" part.
So I believe it is correct. But again, I may be wrong.