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

detect failed regexes duing multilang upgrade

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.1
    • Fix Version/s: 1.8.2, 1.9
    • Component/s: Filters
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      (The same issue affects the multilang filter itself).

      This seemed to make it work:

      Index: multilangupgrade.php
      ===================================================================
      RCS file: /cvsroot/moodle/moodle/admin/multilangupgrade.php,v
      retrieving revision 1.4
      diff -c -r1.4 multilangupgrade.php

          • multilangupgrade.php 15 Jun 2007 06:08:51 -0000 1.4
          • multilangupgrade.php 18 Jun 2007 08:41:03 -0000
            ***************
          • 59,65 ****
            if ($rs and $rs->RecordCount() > 0) {
            while (!$rs->EOF) {
            $text = $rs->fields[$column];
            ! $search = '/(<(?:lang|span) lang="[a-zA-Z0-9_-]".?>.?<\/(?:lang|span)>)(\s*<(?:lang|span) lang="[a-zA-Z0-9_-]".?>.?<\/(?:lang|span)>)+/is';
            $newtext = preg_replace_callback($search, 'multilangupgrade_impl', $text);
            if ($newtext != $text) {
            $newtext = addslashes($newtext);
          • 59,65 ----
            if ($rs and $rs->RecordCount() > 0) {
            while (!$rs->EOF) {
            $text = $rs->fields[$column];
            ! $search = '/(<(?:lang|span) lang="[a-zA-Z0-9_-]".?>.+?<\/(?:lang|span)>)/is';
            $newtext = preg_replace_callback($search, 'multilangupgrade_impl', $text);
            if ($newtext != $text) {
            $newtext = addslashes($newtext);

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/07