Elgg  Version 1.9
Namespaces | Functions
input.php File Reference

Go to the source code of this file.

Namespaces

 Elgg\Core
 Activate a plugin or plugins.
 

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...
 
 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)
 Load all the GET and POST variables into the sticky form cache. More...
 
 elgg_clear_sticky_form ($form_name)
 Clear the sticky form cache. More...
 
 elgg_is_sticky_form ($form_name)
 Has this form been made sticky? More...
 
 elgg_get_sticky_value ($form_name, $variable= '', $default=null, $filter_result=true)
 Get a specific sticky variable. More...
 
 elgg_get_sticky_values ($form_name, $filter_result=true)
 Get all the values in a sticky form in an array. More...
 
 elgg_clear_sticky_value ($form_name, $variable)
 Clear a specific sticky variable. More...
 
 input_livesearch_page_handler ($page)
 Page handler for autocomplete endpoint. More...
 
 _elgg_stripslashes_arraykeys ($array)
 Strip slashes from array keys. More...
 
 _elgg_stripslashes_deep ($value)
 Strip slashes. More...
 
 _elgg_input_init ()
 Initialize the input library. More...
 

Function Documentation

_elgg_input_init ( )

Initialize the input library.

Returns
void private

Definition at line 527 of file input.php.

_elgg_stripslashes_arraykeys (   $array)

Strip slashes from array keys.

Parameters
array$arrayArray of values
Returns
array Sanitized array private

Definition at line 487 of file input.php.

_elgg_stripslashes_deep (   $value)

Strip slashes.

Parameters
mixed$valueThe value to remove slashes from
Returns
mixed private

Definition at line 511 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 106 of file input.php.

elgg_clear_sticky_form (   $form_name)

Clear the sticky form cache.

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 171 of file input.php.

elgg_clear_sticky_value (   $form_name,
  $variable 
)

Clear a specific sticky variable.

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 254 of file input.php.

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

Get a specific sticky variable.

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 205 of file input.php.

elgg_get_sticky_values (   $form_name,
  $filter_result = true 
)

Get all the values in a sticky form in an array.

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 228 of file input.php.

elgg_is_sticky_form (   $form_name)

Has this form been made sticky?

Parameters
string$form_nameForm namespace
Returns
boolean
Since
1.8.0

Definition at line 186 of file input.php.

elgg_make_sticky_form (   $form_name)

Load all the GET and POST variables into the sticky form 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 144 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 94 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.

input_livesearch_page_handler (   $page)

Page handler for autocomplete endpoint.

/livesearch?q=<query>

Other options include: match_on string all or array(groups|users|friends) match_owner int 0/1 limit int default is 10 name string default "members"

Parameters
array$page
Returns
string JSON string is returned and then exit private

Definition at line 278 of file input.php.

is_email_address (   $address)

Validates an email address.

Parameters
string$addressEmail address.
Returns
bool

Definition at line 129 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 72 of file input.php.