API17

JRequest: Difference between revisions

From Joomla! Documentation

Enav (talk | contribs)
No edit summary
m preparing for archive only
 
(6 intermediate revisions by 2 users not shown)
Line 2: Line 2:
=={{JVer|11.1}} JRequest==
=={{JVer|11.1}} JRequest==
===Description===
===Description===
{{Description:JRequest}}
[[API15:JRequest|JRequest]] provides 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.
<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[Description:JRequest|Edit Descripton]]<nowiki>]</nowiki>
</span>
===Note===
===Note===
JRequest is deprecated get the [[JInput/11.1]] object from the application instead
JRequest is deprecated get the [[API17:JInput]] object from the application instead
===Methods===
===Methods===
{| class="wikitable sortable"
{| class="wikitable sortable"
Line 16: Line 14:
|-
|-
|public static  
|public static  
|[[JRequest::_cleanArray/11.1|_cleanArray]]
|[[API17:JRequest::_cleanArray|_cleanArray]]
|Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked.  
|Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked.  
|-
|-
|public static  
|public static  
|[[JRequest::_cleanVar/11.1|_cleanVar]]
|[[API17:JRequest::_cleanVar|_cleanVar]]
|Clean up an input variable.  
|Clean up an input variable.  
|-
|-
|public static  
|public static  
|[[JRequest::checkToken/11.1|checkToken]]
|[[API17:JRequest::checkToken|checkToken]]
|Checks for a form token in the request.  
|Checks for a form token in the request.  
|-
|-
|public static  
|public static  
|[[JRequest::clean/11.1|clean]]
|[[API17:JRequest::clean|clean]]
|Cleans the request from script injection.  
|Cleans the request from script injection.  
|-
|-
|public static  
|public static  
|[[JRequest::get/11.1|get]]
|[[API17:JRequest::get|get]]
|Fetches and returns a request array.  
|Fetches and returns a request array.  
|-
|-
|public static  
|public static  
|[[JRequest::getBool/11.1|getBool]]
|[[API17:JRequest::getBool|getBool]]
|Fetches and returns a given filtered variable.  
|Fetches and returns a given filtered variable.  
|-
|-
|public static  
|public static  
|[[JRequest::getCmd/11.1|getCmd]]
|[[API17:JRequest::getCmd|getCmd]]
|Fetches and returns a given filtered variable.  
|Fetches and returns a given filtered variable.  
|-
|-
|public static  
|public static  
|[[JRequest::getFloat/11.1|getFloat]]
|[[API17:JRequest::getFloat|getFloat]]
|Fetches and returns a given filtered variable.  
|Fetches and returns a given filtered variable.  
|-
|-
|public static  
|public static  
|[[JRequest::getInt/11.1|getInt]]
|[[API17:JRequest::getInt|getInt]]
|Fetches and returns a given filtered variable.  
|Fetches and returns a given filtered variable.  
|-
|-
|public static  
|public static  
|[[JRequest::getMethod/11.1|getMethod]]
|[[API17:JRequest::getMethod|getMethod]]
|Gets the request method.  
|Gets the request method.  
|-
|-
|public static  
|public static  
|[[JRequest::getString/11.1|getString]]
|[[API17:JRequest::getString|getString]]
|Fetches and returns a given filtered variable.  
|Fetches and returns a given filtered variable.  
|-
|-
|public static  
|public static  
|[[JRequest::getURI/11.1|getURI]]
|[[API17:JRequest::getURI|getURI]]
|Gets the full request path.  
|Gets the full request path.  
|-
|-
|public static  
|public static  
|[[JRequest::getVar/11.1|getVar]]
|[[API17:JRequest::getVar|getVar]]
|Fetches and returns a given variable.  
|Fetches and returns a given variable.  
|-
|-
|public static  
|public static  
|[[JRequest::getWord/11.1|getWord]]
|[[API17:JRequest::getWord|getWord]]
|Fetches and returns a given filtered variable.  
|Fetches and returns a given filtered variable.  
|-
|-
|public static  
|public static  
|[[JRequest::set/11.1|set]]
|[[API17:JRequest::set|set]]
|Sets a request variable.  
|Sets a request variable.  
|-
|-
|public static  
|public static  
|[[JRequest::setVar/11.1|setVar]]
|[[API17:JRequest::setVar|setVar]]
|Set a variabe in one of the request variables.  
|Set a variabe in one of the request variables.  
|-
|-
|protected static  
|protected static  
|[[JRequest::_stripSlashesRecursive/11.1|_stripSlashesRecursive]]
|[[API17:JRequest::_stripSlashesRecursive|_stripSlashesRecursive]]
|Strips slashes recursively on an array.  
|Strips slashes recursively on an array.  
|-
|-
Line 89: Line 87:
===See also===
===See also===
* {{JVer|11.1}} '''JRequest source code''' on [[jplatform:environment/request.php|BitBucket]]
* {{JVer|11.1}} '''JRequest source code''' on [[jplatform:environment/request.php|BitBucket]]
* {{JVer|11.1}} Subpackage [[Subpackage Environment/11.1|Environment]]
* {{JVer|11.1}} Subpackage [[API17:Subpackage Environment|Environment]]
* [[JRequest|Other versions of JRequest]]
* [[API17:JRequest|Other versions of JRequest]]
{{SeeAlso:JRequest}}
* [[Retrieving_and_Filtering_GET_and_POST_requests_with_JRequest::getVar|Retrieving and Filtering GET and POST requests with JRequest::getVar]]
<span class="editsection" style="font-size:76%;">
* [[Retrieving data from GET and POST requests]]
<nowiki>[</nowiki>[[SeeAlso:JRequest|Edit See Also]]<nowiki>]</nowiki>
 
</span>
 
===User contributed notes===
===User contributed notes===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
noresultsheader=\n
noresultsheader=\n
category=JRequest
category=JRequest
category=CodeExample
namespace=CodeExample
category=ClassExample
category=ClassExample
include=*
include=*
Line 106: Line 104:
format= ,,,
format= ,,,
</dpl>
</dpl>
<noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JRequest]]</noinclude>
<noinclude>[[Category:Platform 11.1]][[Category:Archived pages API17]]</noinclude>

Latest revision as of 03:35, 25 March 2017

Joomla 11.1 JRequest

Description

JRequest provides 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.

Note

JRequest is deprecated get the API17:JInput object from the application instead

Methods

Visibility Method name Description
public static _cleanArray Adds an array to the GLOBALS array and checks that the GLOBALS variable is not being attacked.
public static _cleanVar Clean up an input variable.
public static checkToken Checks for a form token in the request.
public static clean Cleans the request from script injection.
public static get Fetches and returns a request array.
public static getBool Fetches and returns a given filtered variable.
public static getCmd Fetches and returns a given filtered variable.
public static getFloat Fetches and returns a given filtered variable.
public static getInt Fetches and returns a given filtered variable.
public static getMethod Gets the request method.
public static getString Fetches and returns a given filtered variable.
public static getURI Gets the full request path.
public static getVar Fetches and returns a given variable.
public static getWord Fetches and returns a given filtered variable.
public static set Sets a request variable.
public static setVar Set a variabe in one of the request variables.
protected static _stripSlashesRecursive Strips slashes recursively on an array.
  • Defined in libraries/joomla/environment/request.php

Importing

jimport( 'joomla.environment.request' );

See also


User contributed notes

Code Examples