Elgg
Version master
|
Public Member Functions | |
__construct (array $query=[], array $request=[], array $attributes=[], array $cookies=[], array $files=[], array $server=[], $content=null) | |
{} More... | |
initializeTrustedProxyConfiguration (Config $config) | |
Configure trusted proxy servers to allow access to more client information. More... | |
initializeContext () | |
Initialize context stack. More... | |
getContextStack () | |
Returns context stack. More... | |
setRoute (Route $route) | |
Sets the route matched for this request by the router. More... | |
getRoute () | |
Returns the route matched for this request by the router. More... | |
setParam (string $key, $value, bool $override_request=false) | |
Sets an input value that may later be retrieved by get_input. More... | |
getParam (string $key, $default=null, bool $filter_result=true) | |
Get some input from variables passed submitted through GET or POST. More... | |
getParams (bool $filter_result=true) | |
Returns all values parsed from the request. More... | |
getCurrentURL () | |
Returns current page URL. More... | |
getUrlSegments (bool $raw=false) | |
Get the Elgg URL segments. More... | |
setUrlSegments (array $segments) | |
Get a cloned request with new Elgg URL segments. More... | |
getFirstUrlSegment () | |
Get first Elgg URL segment. More... | |
getElggPath () | |
Get the Request URI minus querystring. More... | |
getClientIp () | |
{} More... | |
isXmlHttpRequest () | |
{} More... | |
sniffElggUrl () | |
Sniff the Elgg site URL with trailing slash. More... | |
isRewriteCheck () | |
Is the request for checking URL rewriting? More... | |
isAction () | |
Is the request an action. More... | |
isCliServer () | |
Is PHP running the CLI server front controller. More... | |
isCliServable (string $root) | |
Is the request pointing to a file that the CLI server can handle? More... | |
getFiles (string $input_name) | |
Returns an array of uploaded file objects regardless of upload status/errors. More... | |
getFile (string $input_name, bool $check_for_validity=true) | |
Returns the first file found based on the input name. More... | |
validate () | |
Validate the request. More... | |
correctBaseURL (\Elgg\Config $config) | |
Correct the base URL of the request. More... | |
Public Attributes | |
const | REWRITE_TEST_TOKEN = '__testing_rewrite' |
const | REWRITE_TEST_OUTPUT = 'success' |
bool | $_integration_testing = false |
Protected Member Functions | |
validateRequestHostHeader () | |
Validate that the request was made on the correct host. More... | |
validateRequestBodyTruncated () | |
Validate that the request body hasn't been truncated (eg. More... | |
Protected Attributes | |
$context_stack | |
$route | |
$request_overrides | |
$filtered_params | |
$unfiltered_params | |
Elgg HTTP request.
Definition at line 17 of file Request.php.
Elgg\Http\Request::__construct | ( | array | $query = [] , |
array | $request = [] , |
||
array | $attributes = [] , |
||
array | $cookies = [] , |
||
array | $files = [] , |
||
array | $server = [] , |
||
$content = null |
|||
) |
{}
Definition at line 56 of file Request.php.
Elgg\Http\Request::correctBaseURL | ( | \Elgg\Config | $config | ) |
Correct the base URL of the request.
\Elgg\Config | $config | the Elgg config |
Definition at line 543 of file Request.php.
Elgg\Http\Request::getClientIp | ( | ) |
{}
Definition at line 303 of file Request.php.
Elgg\Http\Request::getContextStack | ( | ) |
Elgg\Http\Request::getCurrentURL | ( | ) |
Returns current page URL.
It uses the configured site URL for the hostname rather than depending on what the server uses to populate $_SERVER.
Definition at line 218 of file Request.php.
Elgg\Http\Request::getElggPath | ( | ) |
Elgg\Http\Request::getFile | ( | string | $input_name, |
bool | $check_for_validity = true |
||
) |
Returns the first file found based on the input name.
string | $input_name | Form input name |
bool | $check_for_validity | If there is an uploaded file, is it required to be valid |
Definition at line 440 of file Request.php.
Elgg\Http\Request::getFiles | ( | string | $input_name | ) |
Returns an array of uploaded file objects regardless of upload status/errors.
string | $input_name | Form input name |
Definition at line 419 of file Request.php.
Elgg\Http\Request::getFirstUrlSegment | ( | ) |
Get first Elgg URL segment.
Definition at line 276 of file Request.php.
Elgg\Http\Request::getParam | ( | string | $key, |
$default = null , |
|||
bool | $filter_result = true |
||
) |
Get some input from variables passed submitted through GET or POST.
If using any data obtained from get_input() in a web page, please be aware that it is a possible vector for a reflected XSS attack. If you are expecting an integer, cast it to an int. If it is a string, escape quotes.
string | $key | The variable name we want. |
mixed | $default | A default value for the variable if it is not found. |
bool | $filter_result | If true, then the result is filtered for bad tags. |
Definition at line 177 of file Request.php.
Elgg\Http\Request::getParams | ( | bool | $filter_result = true | ) |
Returns all values parsed from the request.
bool | $filter_result | Sanitize input values |
Definition at line 190 of file Request.php.
Elgg\Http\Request::getRoute | ( | ) |
Returns the route matched for this request by the router.
Definition at line 135 of file Request.php.
Elgg\Http\Request::getUrlSegments | ( | bool | $raw = false | ) |
Get the Elgg URL segments.
bool | $raw | If true, the segments will not be HTML escaped |
Definition at line 241 of file Request.php.
Elgg\Http\Request::initializeContext | ( | ) |
Elgg\Http\Request::initializeTrustedProxyConfiguration | ( | Config | $config | ) |
Configure trusted proxy servers to allow access to more client information.
Definition at line 79 of file Request.php.
Elgg\Http\Request::isAction | ( | ) |
Elgg\Http\Request::isCliServable | ( | string | $root | ) |
Is the request pointing to a file that the CLI server can handle?
string | $root | Root directory |
Definition at line 389 of file Request.php.
Elgg\Http\Request::isCliServer | ( | ) |
Is PHP running the CLI server front controller.
Definition at line 378 of file Request.php.
Elgg\Http\Request::isRewriteCheck | ( | ) |
Elgg\Http\Request::isXmlHttpRequest | ( | ) |
{}
Definition at line 322 of file Request.php.
Elgg\Http\Request::setParam | ( | string | $key, |
$value, | |||
bool | $override_request = false |
||
) |
Sets an input value that may later be retrieved by get_input.
Note: this function does not handle nested arrays (ex: form input of param[m][n])
string | $key | The name of the variable |
mixed | $value | The value of the variable |
bool | $override_request | The variable should override request values (default: false) |
Definition at line 150 of file Request.php.
Elgg\Http\Request::setRoute | ( | Route | $route | ) |
Sets the route matched for this request by the router.
Route | $route | Route |
Definition at line 121 of file Request.php.
Elgg\Http\Request::setUrlSegments | ( | array | $segments | ) |
Get a cloned request with new Elgg URL segments.
string[] | $segments URL segments |
Definition at line 261 of file Request.php.
Elgg\Http\Request::sniffElggUrl | ( | ) |
Sniff the Elgg site URL with trailing slash.
Definition at line 333 of file Request.php.
Elgg\Http\Request::validate | ( | ) |
Validate the request.
BadRequestException |
Definition at line 464 of file Request.php.
|
protected |
Validate that the request body hasn't been truncated (eg.
exceeded POST max size)
BadRequestException |
Definition at line 499 of file Request.php.
|
protected |
Validate that the request was made on the correct host.
This will prevent malicious requests from being processed
BadRequestException |
Definition at line 478 of file Request.php.
bool Elgg\Http\Request::$_integration_testing = false |
Definition at line 26 of file Request.php.
|
protected |
Definition at line 31 of file Request.php.
|
protected |
Definition at line 46 of file Request.php.
|
protected |
Definition at line 41 of file Request.php.
|
protected |
Definition at line 36 of file Request.php.
|
protected |
Definition at line 51 of file Request.php.
const Elgg\Http\Request::REWRITE_TEST_OUTPUT = 'success' |
Definition at line 20 of file Request.php.
const Elgg\Http\Request::REWRITE_TEST_TOKEN = '__testing_rewrite' |
Definition at line 19 of file Request.php.