Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66319 Remove curly brace syntax for accessing array elements and string offsets
  3. MDL-67034

Required changes to make adodb, google, horde & lti provider libs PHP 7.4 compliant (curly braces)

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. run the following command (requires ag, although advanced grep versions should be able to run it, after all, it's just a regular expression:

      N.b. If you have ack, you should be able to replace ag with ack in the command below. (sudo apt-get install ack)

      $ ag '(\$[0-9a-zA-Z_]+|\))(\[['\''"\w$]+\])?{[^\n=}]+}' \
          lib/adodb lib/google lib/horde lib/ltiprovider --php
      

      1. Verify that you get ZERO matches, that means that there aren't remaining cases.
      2. Using moodle-docker (or any >= PHP7.4 RC4 installation) install phpunit (init.php).
      3. Verify that there isn't any PHP notice/warning related with adodb, google, horde, ltiprovider stuff. (Be warned that there may be lots of notices/warnings/errors, here we are only interested in the adodb, google, horde, ltiprovider ones).
      4. Run phpunit (with that PHP7.4 version).
      5. Verify that there isn't any PHP notice/warning related with adodb, google, horde, ltiprovider. (Be warned that there are lots of notices/warning/errors and failures, here we are only interested in the adodb, google, horde, ltiprovider ones
      6. Verify that travis is passing for php71 and php73 (specifically adodb, google, horde, ltiprovider ones).
      Show
      run the following command (requires ag , although advanced grep versions should be able to run it, after all, it's just a regular expression: N.b. If you have ack, you should be able to replace ag with ack in the command below. (sudo apt-get install ack) $ ag '(\$[0-9a-zA-Z_]+|\))(\[['\''"\w$]+\])?{[^\n=}]+}' \ lib/adodb lib/google lib/horde lib/ltiprovider --php Verify that you get ZERO matches, that means that there aren't remaining cases. Using moodle-docker (or any >= PHP7.4 RC4 installation) install phpunit (init.php). Verify that there isn't any PHP notice/warning related with adodb, google, horde, ltiprovider stuff. (Be warned that there may be lots of notices/warnings/errors, here we are only interested in the adodb, google, horde, ltiprovider ones). Run phpunit (with that PHP7.4 version). Verify that there isn't any PHP notice/warning related with adodb, google, horde, ltiprovider. (Be warned that there are lots of notices/warning/errors and failures, here we are only interested in the adodb, google, horde, ltiprovider ones Verify that travis is passing for php71 and php73 (specifically adodb, google, horde, ltiprovider ones).
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:

      Description

      We have glued 4 libraries here because changes are minimal (1-line change) + readme documenting it.

      In none of the case we are upgrading the libraries because 1) or the patch has not been merged upstream or 2) the libraries are so outdated that there isn't a clear upgrade/replacement for them.

      About the case 2) above, I've created MDL-67033, because we need to decide urgently about some of them.

      These are the 4 changes, related to php74 curly braces, that we need to fix. As commented above, the corresponding readme files will be updated to include a call to this (or to the upstream pull request, if there is any).

      lib/adodb/drivers/adodb-oci8po.inc.php:123:			$c = $sql{$i};
      lib/google/src/Google/Utils.php:65:      $ordinalValue = ord($str{$ret});
      lib/horde/framework/Horde/Crypt/Blowfish/Php/Base.php:331:                $data = $data << 8 | ord($key{$k});
      lib/ltiprovider/src/OAuth/OAuthSignatureMethod.php:59:            $result |= ord($built{$i}) ^ ord($signature{$i});
      

        Attachments

          Activity

            People

            Assignee:
            stronk7 Eloy Lafuente (stronk7)
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Peer reviewer:
            Mathew May
            Integrator:
            Jake Dallimore
            Tester:
            Gladys Basiana
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              13/Jan/20

                Time Tracking

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