CodeIgniter Forums

Full Version: insert bug(CI4)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
here I insert the follow data to mysql.
PHP Code:
$data['password']='$2y$10$ErQlCj/Mo10il.FthAm0WOjYdf3chZEGPFqaPzjqOX2aj2uYf5Ihq' 
when I check the database, the data was changed to
Code:
y\$ErQlCj/Mo10il.FthAm0WOjYdf3chZEGPFqaPzjqOX2aj2uYf5Ihq
please note "$2y$10" was changed to "y\" and theĀ number of characters was changed too(from 60 to 56).

I guess this is might be a bug?
Are you on the most recent version? I discovered and fixed a similar bug a couple of weeks ago.
(11-14-2016, 08:49 PM)kilishan Wrote: [ -> ]Are you on the most recent version? I discovered and fixed a similar bug a couple of weeks ago.

Yes, I am using the latest version. it seems that the data wasĀ filtered. please check it again.
Ok. I have an idea what it might be as I was just fighting with that portion of the code over the last few days... I'll take another look. Thanks.
I was spot on with what I thought the issue was. I had a little manual filtering that used to be necessary, but started using preg_quote to prep the strings in the Query class, and the manual filtering (specifically for passwords...sigh) was getting in the way. Pull down the latest code and it should be fixed.
(11-14-2016, 09:35 PM)kilishan Wrote: [ -> ]I was spot on with what I thought the issue was. I had a little manual filtering that used to be necessary, but started using preg_quote to prep the strings in the Query class, and the manual filtering (specifically for passwords...sigh) was getting in the way. Pull down the latest code and it should be fixed.

THanks, it works well now.
Excellent. Glad to hear it.
Using password_hash and crypt you need to be careful that they do not include any NULL BYTES or it will truncate it.
(11-15-2016, 06:52 AM)InsiteFX Wrote: [ -> ]Using password_hash and crypt you need to be careful that they do not include any NULL BYTES or it will truncate it.

Yet again, while not incorrect, your comment is irrelevant.