FOSSology  4.4.0
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()

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/runner/work/fossology/fossology/src/www/ui/ui-picker.php.

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

◆ Traceback_parm()

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 109 of file common-parm.php.

◆ Traceback_parm_keep()

Traceback_parm_keep (   $List)

Create a new URI, keeping only these items.

Parameters
array$ListArray of parameter names

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

Variable Documentation

◆ PARM_INTEGER

const PARM_INTEGER 1

Integer parameter

Examples
/home/runner/work/fossology/fossology/src/www/ui/ui-picker.php.

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

◆ PARM_NUMBER

const PARM_NUMBER 2

Number (decimal) parameter

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

◆ PARM_RAW

const PARM_RAW 5

Raw parameter

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

◆ PARM_STRING

const PARM_STRING 3

String parameter (URI decoded)

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

◆ PARM_TEXT

const PARM_TEXT 4

String parameter (stripslashed)

Examples
/home/runner/work/fossology/fossology/src/www/ui/ui-picker.php.

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