MDL-25720 moodlelib new PARAM_RAW_TRIMMED.
Will be required by the new question engine.
This commit is contained in:
@@ -182,6 +182,11 @@ define('PARAM_PERMISSION', 'permission');
|
||||
*/
|
||||
define('PARAM_RAW', 'raw');
|
||||
|
||||
/**
|
||||
* PARAM_RAW_TRIMMED like PARAM_RAW but leading and trailing whitespace is stripped.
|
||||
*/
|
||||
define('PARAM_RAW_TRIMMED', 'raw_trimmed');
|
||||
|
||||
/**
|
||||
* PARAM_SAFEDIR - safe directory name, suitable for include() and require()
|
||||
*/
|
||||
@@ -553,6 +558,9 @@ function clean_param($param, $type) {
|
||||
case PARAM_RAW: // no cleaning at all
|
||||
return $param;
|
||||
|
||||
case PARAM_RAW_TRIMMED: // no cleaning, but strip leading and trailing whitespace.
|
||||
return trim($param);
|
||||
|
||||
case PARAM_CLEAN: // General HTML cleaning, try to use more specific type if possible
|
||||
// this is deprecated!, please use more specific type instead
|
||||
if (is_numeric($param)) {
|
||||
|
||||
Reference in New Issue
Block a user