Extensive update to ensure we scrub/sanitize ALL input of $_GET or $_POST data
(cherry picked from commit 5723379)