The Joomla Extensions Directory puts pressure on developers not to use global variables (superglobals) such as $_SERVER, $_REQUEST, $_POST, $_GET, $_FILES, $_ENV, $_COOKIE, and $_SESSION to prevent SQL injections.
I'm mostly concerned about the $_GET variable which is widely used in my extension. What's the best way of replacing $_GET without having to make too many changes to the application?
The
JApplicationObject has a propertyinputwhich holds all $_POST and $_GET Data for you. It works something like that:There is plenty of documentation out there for for the use of that input object. Here is the API Documentation
$_SERVER, $_SESSION and others are replaces with userState and similar mechanisms, there really is no need to use of superglobals in Joomla.