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

Required changes to make markdown lib PHP 7.4 compliant (curly braces)

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.8, 3.9
    • Fix Version/s: 3.8.1
    • Component/s: Libraries
    • Labels:
    • 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:

        $ ag '(\$[a-z_]+|\))(\[\w]+)?{[^\n=}]+}' lib/markdown --php
        

      2. Verify that you only get 3 matches (1 in Markdown.php and 2 in MarkdownExtra.php). They are false positives, corresponding to regular expressions are it's ok for them to exist.
      3. Using moodle-docker (or any >= PHP7.4 RC4 installation) install phpunit (init.php).
      4. Verify that there isn't any PHP notice/warning related with lib/markdown stuff. (Be warned that there may be lots of notices/warnings/errors, here we are only interested in the lib/markdown ones).
      5. Verify that travis is passing for php71 and php73 (specifically core_markdown_testcase).
      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: $ ag '(\$[a-z_]+|\))(\[\w]+)?{[^\n=}]+}' lib/markdown --php Verify that you only get 3 matches (1 in Markdown.php and 2 in MarkdownExtra.php). They are false positives, corresponding to regular expressions are it's ok for them to exist. Using moodle-docker (or any >= PHP7.4 RC4 installation) install phpunit (init.php). Verify that there isn't any PHP notice/warning related with lib/markdown stuff. (Be warned that there may be lots of notices/warnings/errors, here we are only interested in the lib/markdown ones). Verify that travis is passing for php71 and php73 (specifically core_markdown_testcase).
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:

      Description

      The markdown library v1.8.0 that it's being used right now is not php74 compliant:

      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 955
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 955
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 1361
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 1386
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 1361
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 1386
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 1799
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 1801
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 1799
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/Markdown.php on line 1801
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 215
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 217
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 215
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 217
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 511
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 518
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 552
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 511
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 511
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 518
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 552
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 552
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 567
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 568
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 667
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 677
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 567
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 568
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 667
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 677
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 677
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 677
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 686
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 687
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 686
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 687
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 1074
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 1074
      PHP Deprecated:  Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 1469
       
      Deprecated: Array and string offset access syntax with curly braces is deprecated in /var/www/html/lib/markdown/MarkdownExtra.php on line 1469
      

      This is about to achieve php74 compliance, apparently can be achieved applying this commit, because there isn't any new release including the fix.

        Attachments

          Activity

            People

            Assignee:
            stronk7 Eloy Lafuente (stronk7)
            Reporter:
            stronk7 Eloy Lafuente (stronk7)
            Peer reviewer:
            Mathew May
            Integrator:
            Jun Pataleta
            Tester:
            Jun Pataleta
            Participants:
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            Votes:
            0 Vote for this issue
            Watchers:
            3 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, 46 minutes
                2h 46m