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

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Minor Minor
    • 3.8.1
    • 3.8, 3.9
    • Libraries
    • MOODLE_38_STABLE, MOODLE_39_STABLE
    • MOODLE_38_STABLE
    • 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).

      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.

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Mathew May Mathew May
            Jun Pataleta Jun Pataleta
            Jun Pataleta Jun Pataleta
            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 - 2 hours, 46 minutes
                2h 46m

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