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

    • Task
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.9.6, 2.0
    • 2.0
    • General
    • None
    • MOODLE_19_STABLE, MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Easy

    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

              andyjdavis Andrew Davis
              aborrow Anthony Borrow
              Nobody Nobody
              Adrian Greeve, David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                24/Nov/10