Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-26697 mediaplugin fixes and improvements META
  3. MDL-14782

filtering doesn't work when nothing between <a ...> and </a> tag

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.3, 1.9
    • Fix Version/s: 2.0.3
    • Component/s: Filters
    • Labels:
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      hello,

      I use an application which generates html (validated). And filtering doesn't work. I find it is because there are in the document (I don't no exactly why) empty links followed by other links. That is for example:
      <a href="moodle.org></a>
      some words. A lot of words. <a href="moodle.org"> Moodle</a>

      No filter works between the two links.

      I found the problem : It is in the "filter_save_ignore_tags" function in the lib/filterlib.php.
      The regular expression use a "+" . If I put a "*" at the place, the problem was corrected.

      $pregexp = '/'.$opentag.'(.+?)'.$closetag.'/is';

      became :

      $pregexp = '/'.$opentag.'(.*?)'.$closetag.'/is';

      I don't know if it the ultime solution because I don't know why a "+" was used.

        Attachments

          Activity

            People

            Assignee:
            skodak Petr Skoda
            Reporter:
            testeur Etienne Rozé
            Participants:
            Component watchers:
            Jake Dallimore, Jun Pataleta
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              5/May/11