Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class JRequest

Description

JRequest Class

This class serves to provide the Joomla Framework with a common interface to access request variables. This includes $_POST, $_GET, and naturally $_REQUEST. Variables can be passed through an input filter to avoid injection or returned raw.

Located in /joomla/environment/request.php (line 46)

Class JRequest   (Subpackage Environment)
Method Summary
Static method static void clean ()
Static method static mixed get ([string $hash = 'default'], [int $mask = 0])
Static method static mixed getVar (string $name, [string $default = null], [string $hash = 'default'], [string $type = 'none'], [int $mask = 0])
Method string getURI ()
Method void set ( $array, [ $hash = 'default'], [ $overwrite = true])
Method void setVar ( $name, [ $value = null], [ $hash = 'default'], [ $overwrite = true])
Method void _cleanArray ( &$array, [boolean $globalise = false], array $array)
Method void _cleanVar ( $var, [ $mask = 0], [ $type = null])
Method array _stripSlashesRecursive ( $value, array $array)
Methods
clean (line 275)

Cleans the request from script injection.

  • since: 1.5
void clean ()
get (line 208)

Fetches and returns a request array.

The default behaviour is fetching variables depending on the current request method: GET and HEAD will result in returning $_GET, POST and PUT will result in returning $_POST.

You can force the source by setting the $hash parameter:

post $_POST get $_GET files $_FILES cookie $_COOKIE method via current $_SERVER['REQUEST_METHOD'] default $_REQUEST

  • return: Request hash
  • since: 1.5
mixed get ([string $hash = 'default'], int $mask)
  • string $hash: to get (POST, GET, FILES, METHOD)
  • int $mask: Filter mask for the variable
getURI (line 52)

Gets the full request path

string getURI ()
getVar (line 84)

Fetches and returns a given variable.

The default behaviour is fetching variables depending on the current request method: GET and HEAD will result in returning an entry from $_GET, POST and PUT will result in returning an entry from $_POST.

You can force the source by setting the $hash parameter:

post $_POST get $_GET files $_FILES cookie $_COOKIE method via current $_SERVER['REQUEST_METHOD'] default $_REQUEST

  • return: Requested variable
  • since: 1.5
mixed getVar (string $name, [string $default = null], [string $hash = 'default'], [string $type = 'none'], int $mask)
  • string $name: Variable name
  • string $default: Default value if the variable does not exist
  • string $hash: Where the var should come from (POST, GET, FILES, COOKIE, METHOD)
  • string $type: Return type for the variable (INT, FLOAT, STRING, BOOLEAN, ARRAY)
  • int $mask: Filter mask for the variable
set (line 261)
void set ( $array, [ $hash = 'default'], [ $overwrite = true])
  • $array
  • $hash
  • $overwrite
setVar (line 143)
void setVar ( $name, [ $value = null], [ $hash = 'default'], [ $overwrite = true])
  • $name
  • $value
  • $hash
  • $overwrite
_cleanArray (line 329)

Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked

  • since: 1.5
  • access: protected
void _cleanArray ( &$array, [boolean $globalise = false], array $array)
  • array $array: Array to clean
  • boolean $globalise: True if the array is to be added to the GLOBALS
  • &$array
_cleanVar (line 349)
void _cleanVar ( $var,  $mask, [ $type = null])
  • $var
  • $mask
  • $type
_stripSlashesRecursive (line 394)

Strips slashes recursively on an array

  • return: The input array with stripshlashes applied to it
  • access: protected
array _stripSlashesRecursive ( $value, array $array)
  • array $array: Array of (nested arrays of) strings
  • $value

Documentation generated on Mon, 05 Mar 2007 21:20:12 +0000 by phpDocumentor 1.3.1