FOSSology  3.2.0rc1
Open Source License Compliance by Open Source Software
common-parm.php File Reference

Common function of REQUEST parmeters. More...

Go to the source code of this file.

Functions

 GetParm ($parameterName, $parameterType)
 This function will retrieve the variables and check data types. More...
 
 Traceback ()
 Get the URI + query to this location.
 
 Traceback_uri ()
 Get the URI without query to this location.
 
 Traceback_parm ($ShowMod=1)
 Get the URI query to this location. More...
 
 Traceback_parm_keep ($List)
 Create a new URI, keeping only these items. More...
 
 Traceback_dir ()
 Get the directory of the URI without query.
 
 tracebackTotalUri ()
 Get the total url without query.
 

Variables

const PARM_INTEGER 1
 
const PARM_NUMBER 2
 
const PARM_STRING 3
 
const PARM_TEXT 4
 
const PARM_RAW 5
 

Detailed Description

Common function of REQUEST parmeters.

Definition in file common-parm.php.

Function Documentation

GetParm (   $parameterName,
  $parameterType 
)

This function will retrieve the variables and check data types.

Plugins should not use globals to access HTTP variables. This is because HTTP variables may contain hostile code/values.

  • PARM_INTEGER: Only integers are returned.
  • PARM_NUMBER: Only numbers (decimals are fine) are returned.
  • PARM_STRING: The variable is converted from URI encoding to text.
  • PARM_TEXT: Like PARM_STRING, but all safe quoting is removed.
  • PARM_RAW: Return the raw value.

If the variable does not exist, OR is the wrong type (e.g., a string when it should be a number), then nothing is returned.

Note
If a plugin wants to access these variable directly, it can. But it is responsible for all safety checks.
Parameters
string$parameterNameVariable name
$parameterTypeVariable type (see the defines for allowed values)
Returns
String of variables
Examples:
/home/travis/build/GMishx/fossology/src/www/ui/ui-picker.php.

Definition at line 57 of file common-parm.php.

Traceback_parm (   $ShowMod = 1)

Get the URI query to this location.

If ShowMod is set, then the module name is included. Else, this begins with the first parameter.

Definition at line 120 of file common-parm.php.

Traceback_parm_keep (   $List)

Create a new URI, keeping only these items.

Parameters
array$ListArray of parameter names

Definition at line 147 of file common-parm.php.

Variable Documentation

const PARM_INTEGER 1

Integer parameter

Examples:
/home/travis/build/GMishx/fossology/src/www/ui/ui-picker.php.

Definition at line 25 of file common-parm.php.

const PARM_NUMBER 2

Number (decimal) parameter

Definition at line 27 of file common-parm.php.

const PARM_RAW 5

Raw parameter

Definition at line 33 of file common-parm.php.

const PARM_STRING 3

String parameter (URI decoded)

Definition at line 29 of file common-parm.php.

const PARM_TEXT 4

String parameter (stripslashed)

Examples:
/home/travis/build/GMishx/fossology/src/www/ui/ui-picker.php.

Definition at line 31 of file common-parm.php.