I've tested my site with the Acunetix software.
One of the types of HTTP requests that the Acunetix software sends.
Acunetix Software instead of numeric and string parameters, sends an array.for example:
true quey string:(username is string)
http://localhost/yii/framework/apa/index.php?r=site/login & username=test
Acunetix's request:
http://localhost/yii/framework/apa/index.php?r=site/login & username[]=test
Acunetix's request send username[] as array.but Program is waiting for a string.
finally Occurs the Error Page.This page contains an error/warning message that may disclose sensitive
information.The message can also contain the location of the file that produced the unhandled exception.
I solve this problem whith:
class LoginForm extends CFormModel
{
.....
protected function beforeValidate() {
if(
!is_string($this->username)||
!is_string($this->password)
)
{
throw new CHttpException(400,'Invalid request.');
}
parent::beforeValidate();
return true;
}
}
but for r parameter.Software following a request sent to the site:
http://localhost/yii/framework/apa/index.php?r[]=site/index
Parameter r is array Instead string.
Occurs the following error:
Quote
trim() expects parameter 1 to be string, array given
In your opinion, what is the solution for this error?

Help















