PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Fix for localizations that use . and , differently

  1. sboisvert@bryxal.ca
    Member

    When using French Canadian Localization on the server. The floats will be converted from 1.1 to 1,1 in the SQL (the %f) and will mess up the query to get the detail_long.
    Changing line 2305 of forms_model.php from:

    WHERE lead_id=%d AND field_number BETWEEN %f AND %f", $lead["id"], $field_number - 0.001, $field_number + 0.001);

    to this one where the double gets interpreted in PHP and then passed as a string in SQL, you get the same level of security just at a different layer.

    WHERE lead_id=%d AND field_number BETWEEN %s AND %s", $lead["id"], doubleval($field_number - 0.001),doubleval($field_number + 0.001));

    Thank you

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  2. I don't have a problem making this change, but I think changing the number localization on the server will create other problems as well. Are you sure this is the only change needed?

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  3. sboisvert@bryxal.ca
    Member

    Thanks!
    I'm not 100% sure, that it is the only change to get rid of any and all bugs regarding running wp in a localized environement. But this change Gets rid of all the apparent bugs regarding fields longer than the varchar in non-en_us localizations. I will let you know if we find others.

    Thanks again,

    -Steph

    Posted 12 years ago on Thursday May 10, 2012 | Permalink
  4. Ok. I have a dev version with the changes. If you want to give it a try, email me to alex@rocketgenius.com and I will send it your way.

    Posted 12 years ago on Thursday May 10, 2012 | Permalink