[TASK] Fix some CGL issues spotted during backporting

This patch fixes some cgl problems spotted while
syncing Flow Fluid and CMS Fluid

Change-Id: I9e4da6fe26d54a16b58633a235ca7bfb7519929a
Resolves: #44710
Releases: master
[!!!][BUGFIX] urlencode viewhelper accepts objects with __toString

This fixes a problem with the urlencode view helper. If you pass it an
object with __toString() method – for example an URI object – it is
returned as is. Now the view helper additionally checks for a
__toString() method.

This change is breaking if you rely on the viewhelper to return
values that are not a string or an object with __toString.
The viewhelper will now throw an exception in this case.

Change-Id: Ibf53dab49b47f8a73870dc53b8e6380b38cd01ec
Fixes: #44889
Releases: 2.0, master
Merge "[TASK] Fix some CGL issues spotted during backporting"
Merge "[!!!][BUGFIX] urlencode viewhelper accepts objects with __toString"