Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-2992

PHP's setlocale has different default values

    XMLWordPrintable

Details

    • Critical
    • Hide
      5.7.4
      The PHP's system locale was not correctly set. This is due a strange behaviour setting the default locale randomly.
      6.3.0
      Some small code improvements
      Show
      5.7.4 The PHP's system locale was not correctly set. This is due a strange behaviour setting the default locale randomly. 6.3.0 Some small code improvements
    • -

    Description

      problem

      The database update command was not working anymore on some systems using a password containing special characters.

      reason

      The reason is in the way how PHP sets the default locale, which is depending on the underlying C lib. Therefore the default value may either be the C locale or the one configured in the LC_ALL env variable. For translate5 we were always assuming that setting the LC_ALL var is enough - what is not the case.

      To fix that a setlocale to empty string must be called in the very beginning step of PHPs request processing which then sets the values for sure to the env values. Since this is the assumed behaviour - and was for a long time the default behaviour at least on our production server - we just do that as a fix.

      Attachments

        Activity

          People

            tlauria Thomas Lauria
            tlauria Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: