How to sanitize input parameters with CMSMS? (the built-in mechanism)
Posted: Mon Jun 15, 2009 6:45 am
Hello,
I am trying to sanitize the input parameters using the mechanism that is built-in into CMSMS. For this purpose, in the function "SetParameters()" I am defining this:
and in the file "action.default.php" I am trying to read the params like this:
It doesn't matter how am I sending the 'step' parameter to the form - thru POST or GET. The 'step' is alsways empty.
If I am reading the parameters thru $_REQUEST, $_POST and $_GET everything seems to work:
but the variables are not "cleaned".
Please tell me what am I doing wrong.
Note: I am using the CMSMS version 1.5.4.
Regards,
Razvan
I am trying to sanitize the input parameters using the mechanism that is built-in into CMSMS. For this purpose, in the function "SetParameters()" I am defining this:
Code: Select all
function SetParameters()
{
$this->RestrictUnknownParams();
$this->SetParameterType('step', CLEAN_STRING);
$this->mCachable = false;
}
Code: Select all
$step = $params['step'];
echo "step = '$step' <br />";
If I am reading the parameters thru $_REQUEST, $_POST and $_GET everything seems to work:
Code: Select all
$step = $_REQUEST['step'];
Please tell me what am I doing wrong.
Note: I am using the CMSMS version 1.5.4.
Regards,
Razvan