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

preg_xxxx() critical bug under PHP 5.2.4, tests required...

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.7.3, 1.8.3, 1.9
    • 1.7.3, 1.8.3, 1.9
    • None
    • None
    • PHP 5.2.4
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE

    Description

      I was trying to detect why one MSSQL server was causing a lot of problems with simple SQLs when I've discovered that the root of the problem was that one preg_match_all() function wasn't performing its job under BIG texts.

      I've attached one script (preg_match_all_test.php) that reproduce the problem in my system. Curiously, the limit seems to be 99998 chars. By adding one more char (99999) the function doesn't work properly.

      It's a major problem because it can break tons of things (the mssql_n driver, backup & restore relinking, filters...) potentially anything trying to grep over more than 99998 chars.

      Please, can you execute the script and add your results here? TIA!

      Attachments

        1. preg_match_all_test.php
          0.6 kB
          Eloy Lafuente (stronk7)

        Issue Links

          Activity

            People

              dougiamas Martin Dougiamas
              stronk7 Eloy Lafuente (stronk7)
              Nobody Nobody
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Oct/07