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

Evaluate best way to handle PHP deprecation of ereg_replace and eregi_replace function in PHP 5.3.0

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.9.6, 2.0
    • Fix Version/s: 2.0
    • Component/s: General
    • Labels:
      None
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      With the MRBS block I was recently alerted to the PHP deprecation (as of 5.3.0) of ereg_replace. It looks like through most of Moodle 2.0 the ereg_replace and eregi_replace calls have been replaced with preg_replace; however, a search of the code base shows that it is still present in some places in Moodle 2.0 and widely through 1.9. Since preg_replace is PHP 4 compatible it seems safe to just replace it but with PHP 5.3.0 being the current stable release it seems important to make sure we clean up the code so as to avoid folks getting the deprecation warnings. Peace - Anthony

        Attachments

        1. 091118_MDL20821_19patch.txt
          135 kB
        2. MDL20821_19patch.txt
          45 kB
        3. MDL20821trunkpatch.txt
          15 kB
        4. MDL20821trunkpatch2.txt
          49 kB
        5. regextest.php
          0.4 kB

          Issue Links

            Activity

              People

              Assignee:
              andyjdavis Andrew Davis
              Reporter:
              aborrow Anthony Borrow
              Tester:
              Nobody
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                24/Nov/10