mb_strlen() expects parameter 1 to be string, array given

Hi,

a few days before i updated the framework directory from yii 116 to yii 117.

Most of the application workes fine, but there are problems by validating checkboxes.

I’m using an MySQL Table based Model. “PRIORITY” is one of the models attributes. The user fills that model by using an form. This form contents a checkbox to select the “priority”.

To save the attribute priority into the database, an onBeforeSave trigger fired - where the checkbox values are been serialized.


if (!empty($this->PRIORITY)) {$this->PRIORITY=serialize($this->PRIORITY);}

The validation rule for priority is:


array('PRIORITY','length', 'max'=>90),

…where 90 is the maximum length of the serialized array, which was generated through the form.

That workes fine until yii 1.1.6. From yii 1.1.7 the error occurres:


mb_strlen() expects parameter 1 to be string, array given

So what could be a way to solve that problem?

Setting PRIORITY to "safe"?

Thank you, rall0r