Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-75951

Look for deprecated uses of the auto_detect_line_endings ini setting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.1.1
    • 4.1
    • Libraries
    • MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • MDL-75951-401
    • MDL-75951-master
    • Hide

      Note: This should be tested with PHP 7.4, 8.0, and 8.1
      Note: PHP 8.1 will spit out a bunch of deprecation warnings

      1. Download the attached testsprout.php
      2. Run it in the CLI:

        php testspout.php
        

        1. Confirm that it prints a list of groups with data
      3. PHP 8.1 only:
        1. Confirm that there was no warning about use of the auto_detect_line_endings ini settings
          Note: There will be lots of other deprecation warnings - we only care about the auto_detect_line_endings ones.
      Show
      Note: This should be tested with PHP 7.4, 8.0, and 8.1 Note: PHP 8.1 will spit out a bunch of deprecation warnings Download the attached testsprout.php Run it in the CLI: php testspout.php Confirm that it prints a list of groups with data PHP 8.1 only: Confirm that there was no warning about use of the auto_detect_line_endings ini settings Note: There will be lots of other deprecation warnings - we only care about the auto_detect_line_endings ones.

      . The auto_detect_line_endings ini setting has been deprecated. If necessary,
      handle "\r" line breaks manually instead.
      RFC: https://wiki.php.net/rfc/deprecations_php_8_1

      It seems that we have a few uses in the spout library:

      $ ag 'auto_detect_line_endings' --php
      lib/spout/src/Spout/Reader/CSV/Reader.php
      22:    /** @var string Original value for the "auto_detect_line_endings" INI value */
      87:        $this->originalAutoDetectLineEndings = \ini_get('auto_detect_line_endings');
      88:        \ini_set('auto_detect_line_endings', '1');
      126:        \ini_set('auto_detect_line_endings', $this->originalAutoDetectLineEndings);
      

      Need to verify how they affect us, if that code is used by core, look to upstream library (to see if it has been fixed) and proceed to fix it, if needed to.

      Ciao

            dobedobedoh Andrew Lyons
            stronk7 Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Ilya Tregubov Ilya Tregubov
            Kim Jared Lucas Kim Jared Lucas
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 55 minutes
                1h 55m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.