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

php exception because of the wrong version

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.7.3
    • 2.7.4, 2.8.2
    • Libraries
    • MOODLE_27_STABLE
    • MOODLE_27_STABLE, MOODLE_28_STABLE
    • MDL-48587-master
    • Easy
    • Hide
      1. Run this unit tests (won't take long):
        1. vendor/bin/phpunit lib/tests/moodlelib_test.php
      2. Verify it all passes
      3. Install Moodle 2.6 on PHP 5.3.x (for example using downloaded package from https://download.moodle.org/windows/)
      4. Replace the code in moodle directory with version 2.7 (leave the old config.php)
      5. Open the moodle instance
      6. The error about the insufficient php version should be displayed
      7. Replace with 2.8, upgrade and ensure the error is displayed
      8. Replace code with master, upgrade and ensure the error is displayed
      Show
      Run this unit tests (won't take long): vendor/bin/phpunit lib/tests/moodlelib_test.php Verify it all passes Install Moodle 2.6 on PHP 5.3.x (for example using downloaded package from https://download.moodle.org/windows/ ) Replace the code in moodle directory with version 2.7 (leave the old config.php) Open the moodle instance The error about the insufficient php version should be displayed Replace with 2.8, upgrade and ensure the error is displayed Replace code with master, upgrade and ensure the error is displayed
    • BACKEND Sprint 19

    Description

      Reported here: https://moodle.org/mod/forum/discuss.php?d=276367

      Parse error: syntax error, unexpected '[' in \\server\moodle\lib\moodlelib.php on line 8633
      

      This should work fine on php 5.4 and above (which is required) but it looks like the this function is called before php version check and the error message in confusing for the user.

      It's not difficult to re-write $address = explode(":", $address)[0]; into the code compatible with older php versions

      Attachments

        Issue Links

          Activity

            People

              johno John Okely
              marina Marina Glancy
              Mark Nelson Mark Nelson
              Dan Poltawski Dan Poltawski
              Adrian Greeve Adrian Greeve
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                12/Jan/15