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

lib/pear/HTML/QuickForm/date.php needs to fix curly brace string char accessor for php 7.4

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 3.9.3, 3.9.4, 3.10.1
    • 3.9.5, 3.10.2
    • Libraries
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MOODLE_310_STABLE, MOODLE_39_STABLE
    • MDL-70457_311
    • Easy
    • Hide

      Before the patch

      1. Using PHP 7.4
      2. Copy the attached test70457.php file to the moodle-root directory.
      3. From terminal, execute it (php test70457.php).
      4. Verify that you get the PHP deprecation notices: Deprecated: Array and string offset access syntax with curly braces is deprecated in ... lib/pear/HTML/QuickForm/date.php on line ...

      After the patch

      1. Repeat steps 1-3 from "Before the patch".
      2. Verify that there aren't deprecation notices anymore.
      Show
      Before the patch Using PHP 7.4 Copy the attached test70457.php file to the moodle-root directory. From terminal, execute it ( php test70457.php ). Verify that you get the PHP deprecation notices: Deprecated: Array and string offset access syntax with curly braces is deprecated in ... lib/pear/HTML/QuickForm/date.php on line ... After the patch Repeat steps 1-3 from "Before the patch". Verify that there aren't deprecation notices anymore.

    Description

      $sign = $this->_options['format']{$i};
      

      needs to be changed to

      $sign = $this->_options['format'][$i];
      

      Attachments

        1. MDL-70457.jpg
          MDL-70457.jpg
          29 kB
        2. test70457.php
          0.3 kB

        Activity

          People

            stronk7 Eloy Lafuente (stronk7)
            jameskinsman James Kinsman
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Jun Pataleta Jun Pataleta
            Anna Carissa Sadia Anna Carissa Sadia
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              8/Mar/21

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 35 minutes
                3h 35m