Elgg  Version 3.0
Namespaces | Functions | Variables
input.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Updates the advanced settings for the primary site object.
 

Functions

 get_input ($variable, $default=null, $filter_result=true)
 Get some input from variables passed submitted through GET or POST. More...
 
 set_input ($variable, $value)
 Sets an input value that may later be retrieved by get_input. More...
 
 elgg_get_request_data ($filter_result=true)
 Returns all values parsed from the current request, including $_GET and $_POST values, as well as any values set with set_input() More...
 
 elgg_get_title_input ($variable= 'title', $default= '')
 Get an HTML-escaped title from input. More...
 
 filter_tags ($var)
 Filter tags from a given string based on registered hooks. More...
 
 current_page_url ()
 Returns the current page's complete URL. More...
 
 is_email_address ($address)
 Validates an email address. More...
 
 elgg_make_sticky_form ($form_name)
 Save form submission data (all GET and POST vars) into a session cache. More...
 
 elgg_clear_sticky_form ($form_name)
 Remove form submission data from the session. More...
 
 elgg_is_sticky_form ($form_name)
 Does form submission data exist for this form? More...
 
 elgg_get_sticky_value ($form_name, $variable= '', $default=null, $filter_result=true)
 Get a specific value from cached form submission data. More...
 
 elgg_get_sticky_values ($form_name, $filter_result=true)
 Get all submission data cached for a form. More...
 
 elgg_clear_sticky_value ($form_name, $variable)
 Remove one value of form submission data from the session. More...
 
 elgg_is_empty ($value)
 Check if a value isn't empty, but allow 0 and '0'. More...
 
 _elgg_htmlawed_filter_tags ($hook, $type, $result, $params=null)
 htmLawed filtering of data More...
 
 _elgg_htmLawedArray (&$v, $k, $config_spec)
 wrapper function for htmlawed for handling arrays More...
 
 _elgg_htmlawed_tag_post_processor ($element, $attributes=false)
 Post processor for tags in htmlawed. More...
 
 _elgg_htmlawed_test ($hook, $type, $value, $params)
 Runs unit tests for htmlawed. More...
 
 _elgg_disable_password_autocomplete ($hook, $type, $return_value, $params)
 Disable the autocomplete feature on password fields. More...
 
 _elgg_input_init ()
 Initialize the input library. More...
 

Variables

return function (\Elgg\EventsService $events,\Elgg\HooksRegistrationService $hooks)
 

Function Documentation

_elgg_disable_password_autocomplete (   $hook,
  $type,
  $return_value,
  $params 
)

Disable the autocomplete feature on password fields.

Parameters
string$hook'view_vars'
string$type'input/password'
array$return_valuethe current view vars
array$paramssupplied params
Returns
void|array

Definition at line 368 of file input.php.

_elgg_htmlawed_filter_tags (   $hook,
  $type,
  $result,
  $params = null 
)

htmLawed filtering of data

Called on the 'validate', 'input' plugin hook

htmLawed's $config argument is filtered by the [config, htmlawed] hook. htmLawed's $spec argument is filtered by the [spec, htmlawed] hook.

For information on these arguments, see http://www.bioinformatics.org/phplabware/internal_utilities/htmLawed/htmLawed_README.htm#s2.2

Parameters
string$hookHook name
string$typeThe type of hook
mixed$resultData to filter
array$paramsNot used
Returns
mixed

Definition at line 228 of file input.php.

_elgg_htmlawed_tag_post_processor (   $element,
  $attributes = false 
)

Post processor for tags in htmlawed.

This runs after htmlawed has filtered. It runs for each tag and filters out style attributes we don't want.

This function triggers the 'allowed_styles', 'htmlawed' plugin hook.

Parameters
string$elementThe tag element name
array$attributesAn array of attributes
Returns
string

Definition at line 285 of file input.php.

_elgg_htmlawed_test (   $hook,
  $type,
  $value,
  $params 
)

Runs unit tests for htmlawed.

Parameters
string$hook"unit_test"
string$type"system"
string[]$value Test files
array$paramsHook params
Returns
array

Definition at line 353 of file input.php.

_elgg_htmLawedArray ( $v,
  $k,
  $config_spec 
)

wrapper function for htmlawed for handling arrays

Definition at line 267 of file input.php.

_elgg_input_init ( )

Initialize the input library.

Returns
void

Definition at line 385 of file input.php.

current_page_url ( )

Returns the current page's complete URL.

It uses the configured site URL for the hostname rather than depending on what the server uses to populate $_SERVER.

Returns
string The current page URL.
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 94 of file input.php.

elgg_clear_sticky_form (   $form_name)

Remove form submission data from the session.

Call this if validation is successful in the action handler or when they sticky values have been used to repopulate the form after a validation error.

Parameters
string$form_nameForm namespace
Returns
void
Since
1.8.0

Definition at line 136 of file input.php.

elgg_clear_sticky_value (   $form_name,
  $variable 
)

Remove one value of form submission data from the session.

Parameters
string$form_nameThe name of the form
string$variableThe name of the variable to clear
Returns
void
Since
1.8.0

Definition at line 191 of file input.php.

elgg_get_request_data (   $filter_result = true)

Returns all values parsed from the current request, including $_GET and $_POST values, as well as any values set with set_input()

See also
get_input()
set_input()
Parameters
bool$filter_resultSanitize input values
Returns
array

Definition at line 56 of file input.php.

elgg_get_sticky_value (   $form_name,
  $variable = '',
  $default = null,
  $filter_result = true 
)

Get a specific value from cached form submission data.

Parameters
string$form_nameThe name of the form
string$variableThe name of the variable
mixed$defaultDefault value if the variable does not exist in sticky cache
boolean$filter_resultFilter for bad input if true
Returns
mixed
Since
1.8.0

Definition at line 165 of file input.php.

elgg_get_sticky_values (   $form_name,
  $filter_result = true 
)

Get all submission data cached for a form.

Parameters
string$form_nameThe name of the form
bool$filter_resultFilter for bad input if true
Returns
array
Since
1.8.0

Definition at line 178 of file input.php.

elgg_get_title_input (   $variable = 'title',
  $default = '' 
)

Get an HTML-escaped title from input.

E.g. "How to use <b> tags"

Parameters
string$variableThe desired variable name
string$defaultThe default if none given
Returns
string
Since
3.0

Definition at line 69 of file input.php.

elgg_is_empty (   $value)

Check if a value isn't empty, but allow 0 and '0'.

Parameters
mixed$valuethe value to check
See also
empty()
Elgg::isEmpty()
Returns
bool
Since
3.0.0

Definition at line 206 of file input.php.

elgg_is_sticky_form (   $form_name)

Does form submission data exist for this form?

Parameters
string$form_nameForm namespace
Returns
boolean
Since
1.8.0

Definition at line 148 of file input.php.

elgg_make_sticky_form (   $form_name)

Save form submission data (all GET and POST vars) into a session cache.

Call this from an action when you want all your submitted variables available if the submission fails validation and is sent back to the form

Parameters
string$form_nameName of the sticky form
Returns
void
Since
1.8.0

Definition at line 120 of file input.php.

filter_tags (   $var)

Filter tags from a given string based on registered hooks.

Parameters
mixed$varAnything that does not include an object (strings, ints, arrays) This includes multi-dimensional arrays.
Returns
mixed The filtered result - everything will be strings

Definition at line 82 of file input.php.

get_input (   $variable,
  $default = null,
  $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.

Note: this function does not handle nested arrays (ex: form input of param[m][n]) because of the filtering done in htmlawed from the filter_tags call.

Parameters
string$variableThe variable name we want.
mixed$defaultA default value for the variable if it is not found.
bool$filter_resultIf true, then the result is filtered for bad tags.
Returns
mixed
Examples:
/root/Elgg/engine/lib/views.php.

Definition at line 27 of file input.php.

is_email_address (   $address)

Validates an email address.

Parameters
string$addressEmail address.
Returns
bool

Definition at line 105 of file input.php.

set_input (   $variable,
  $value 
)

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])

Parameters
string$variableThe name of the variable
string|string[]$value The value of the variable
Returns
void

Definition at line 41 of file input.php.

Variable Documentation

See also
::loadCore Do not do work here. Just register for events.

Definition at line 397 of file input.php.