Does anyone have an answer for this? I’m having a problem as well. Whenever there’s an ampersand in a string of text I save, it strips the ampersand and everything to the right of it in the string, and just saves the first part.
$item = new Item;
$item->attribute = "Blah & Blah";
$item->save(); //Stores "Blah " in the database
Here’s my rules function. I’m attempting to store the string in the “title” field.
public function rules()
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
array('eq_id, wt_id, location_id, check_id, user_created, user_updated, user_completed, action_needed, action_complete', 'numerical', 'integerOnly'=>true),
array('text, time_created, time_updated, time_completed', 'safe'),
// The following rule is used by search().
// Please remove those attributes that should not be searched.
array('id, eq_id, wt_id, location_id, check_id, user_created, user_updated, user_completed, text, action_needed, action_complete, time_created, time_updated, time_completed, title', 'safe', 'on'=>'search'),
array('title', 'length', 'max'=>64),
array('title, text', 'required')