An implicit validator

Hi!

I’m trying to add the news from my admin panel, and in my text I have a string $25 thousands.

And then it has been saved I see just thousands. So who’s stolen my dollars I dont know :lol:

But if to write $sssdf thousands it saves fine. Cutes only the dollar sight and the digits.

I cant explain with what such behaviour ties. I haven’t any filters in my model. I thought it might be problem with ckeditor, but if I disable any javascript and edit my text in simple textarea it made same effect.

I know it sounds like a joke

Do some debugging. I would start to inspect the POST data (print_r($_POST) never hurts) in the action that saves the values. That should help to identify the source of your problem (client or server).

I tested it. In the $_POST is all ok, with dollar sign.

Well, then do more debugging. Check

  • Attribute values before and after validating

  • Parameters bound to your SQL query

I’m not sure I use these methods right, but these both showed the same ( with signs ). And about bounding, my rules are:


public function rules()

{

	return array(

		array('title', 'length', 'max'=>128, 'encoding' => 'utf-8'),

	);

}

And it is all, nothing about content field. It is the News table and I have field: title, preview, content and others. If I write $25 in title - all saved normal, but in preview and content not. The title is VARCHAR(128) and preview and content are TEXT .

But I noticed a strange thing. If I write: $25 doll $255 doll $2555 doll, after saving it will: doll 5 doll 55 doll. And the only one thought washed over me is RegExps. But what they are doing here.

I don’t know something I seems…

Hey, thanks for pointing me to the new encoding parameter. I’ve totally missed this :). Just added that information to the unicode cookbook.

About your problem: So did you compare the model values at different places? Otherwise it’s hard to find the problematic component. What parameters are logged with your SQL statement?

I myself just knew about it parameter, without this I took a wrong string length)

And about this problem. I little fucked up, it’s not in the saving stage, it’s in the output stage. It’s bacause of contentCompactor extension and I was wondered when knew it :( I don’t know any details how it turned out, but I just turn it off and all display good. Thanks anyway :)