handle array root element

An array to string conversion notice was thrown when the root element of
the thing being validated is an array.
Fixed ACE domain checks on UrlValidator (#10031)
Merge branch '2.3' into 2.4

* 2.3:
  Check headers sent before sending PHP response
  Fixed ACE domain checks on UrlValidator (#10031)
  handle array root element