SMF Development > Fixed or Bogus Bugs

Custom fields data corruption?

(1/1)

mpglivecarlo:
Hi,

I have a forum on SMF V 2.0.2 and i have created some new custom fields that must be filled upon registration and i dont know why this has happened but 2 fields that where configured to be in the custom mask as numeric got "corrupted" information. User registered a long digit number like a phone number and after a while the number in DB was turned into 2147483647.

I have searched the forums to see if there is something wrong on the configuration but havent found the number linked to any custom filed error.

Please help because i am loosing this information because it gets replaced or wrongly stored in the mysql DB.

thanks

live627:
2147483647 is the max value for a 32 bit signed int. This is actually a hardware limitation, capped by the 32 bit architecture.

In your case, since you are pushing gigantic numbers through the system, casting the input to an integer won't help. Instead, treat it as a string. Set the input mask to regex ((regular expression) and use the following:

/^\s*([0-9]+)\s*$/

That will emulate a number. Only digits 0-9 are accepted. Untested. And this change will leave all existing data intact.

mpglivecarlo:

--- Quote from: live627 on May 31, 2012, 03:06:01 AM ---2147483647 is the max value for a 32 bit signed int. This is actually a hardware limitation, capped by the 32 bit architecture.

In your case, since you are pushing gigantic numbers through the system, casting the input to an integer won't help. Instead, treat it as a string. Set the input mask to regex ((regular expression) and use the following:

/^\s*([0-9]+)\s*$/

That will emulate a number. Only digits 0-9 are accepted. Untested. And this change will leave all existing data intact.

--- End quote ---

Thank you very much, i was almost certain that some limitation was there because all searches mentioned the memory limit :S in that fel i set temporaly the no HTML, if users changed the field during this time will it keep the information even if they did not input only numbers?

thx!

Arantor:
Yes, it will. Validation is only re-applied on editing the field.

mpglivecarlo:

--- Quote from: Arantor on May 31, 2012, 07:38:50 PM ---Yes, it will. Validation is only re-applied on editing the field.

--- End quote ---

THX!

Navigation

[0] Message Index

Go to full version