![]() |
Bearsampp 2026.5.5
|
Static Public Member Functions | |
| static | cleanArgv ($name, $type='text') |
| static | cleanGetVar ($name, $type='text') |
| static | cleanPostVar ($name, $type='text') |
| static | sanitizeOutput ($output) |
| static | sanitizePath ($path) |
| static | sanitizePID ($pid) |
| static | sanitizePort ($port) |
| static | sanitizeServiceName ($serviceName) |
Input cleaning and sanitization utilities.
Provides safe access to command-line arguments, GET, and POST variables, plus sanitizers for PIDs, ports, service names, file paths, and HTML output.
Usage:
Definition at line 24 of file class.util.input.php.
|
static |
Cleans and returns a specific command line argument based on the type specified.
| string | $name | The index of the argument in the $_SERVER['argv'] array. |
| string | $type | The type of the argument to return: 'text', 'numeric', 'boolean', or 'array'. |
Definition at line 34 of file class.util.input.php.
Referenced by Action\process().
|
static |
Cleans and returns a specific $_GET variable based on the type specified.
| string | $name | The name of the $_GET variable. |
| string | $type | The type of the variable to return: 'text', 'numeric', 'boolean', or 'array'. |
Definition at line 59 of file class.util.input.php.
Referenced by Homepage\__construct().
|
static |
Cleans and returns a specific $_POST variable based on the type specified.
| string | $name | The name of the $_POST variable. |
| string | $type | The type of the variable to return: 'text', 'number', 'float', 'boolean', 'array', or 'content'. |
Definition at line 88 of file class.util.input.php.
|
static |
Sanitizes output for display to prevent XSS attacks. Escapes HTML special characters.
| string | $output | The output to sanitize. |
Definition at line 235 of file class.util.input.php.
|
static |
Sanitizes a file path by removing null bytes and checking for path traversal attempts. This is a basic sanitization — paths should still be validated before use.
| string | $path | The path to sanitize. |
Definition at line 205 of file class.util.input.php.
References Log\warning().
|
static |
Sanitizes a process ID (PID) by removing all non-numeric characters. This prevents command injection through PID parameters.
| mixed | $pid | The PID to sanitize. |
Definition at line 121 of file class.util.input.php.
References Log\warning().
Referenced by Batch\findExeByPid().
|
static |
Sanitizes a port number by ensuring it's a valid integer in the correct range. This prevents command injection through port parameters.
| mixed | $port | The port to sanitize. |
Definition at line 148 of file class.util.input.php.
References $port, and Log\warning().
Referenced by Batch\getProcessUsingPort().
|
static |
Sanitizes a service name by removing dangerous characters. Allows only alphanumeric characters, underscores, and hyphens.
| string | $serviceName | The service name to sanitize. |
Definition at line 175 of file class.util.input.php.
References Log\warning().
Referenced by Batch\setServiceDescription(), Batch\setServiceDisplayName(), and Batch\setServiceStartType().