Manual:$wgRequest

Overview
  is used as a global singleton that contains an instance of the WebRequest class.

The WebRequest class encapsulates getting at data passed in the URL or via a POSTed form, handling removal of "magic quotes" slashes, stripping illegal input characters and normalizing Unicode sequences.

See the [http://svn.wikimedia.org/doc/classWebRequest.html WebRequest class documentation] and  for more details.

Examples
This code can be useful within hooks>Special:MyLanguage/Manual:Hooks|hook functions when you want to return without executing additional function code if the user is editing, rather than viewing, the current page.

Deprecation
evil>Special:MyLanguage/Manual:Globals are evil|As with other globals, the use of $wgRequest should be avoided when alternative methods are available.

For example, when writing a special>Special:MyLanguage/Manual:Special pages|special page, use the   method provided by the SpecialPage class, e.g.:

When you work with various hooks you can usually get the WebRequest object from the context, for example: