Moodle
  1. Moodle
  2. MDL-15842

incorrect regex searching for A tag

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9
    • Fix Version/s: 1.9.3
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      31258

      Description

      $string = preg_replace('/(<a[^>]?>)(.?)(<\/a>)/is','$2',$string);
      matches <applet tag too

      thanks ELoy for volunteering, I and going to fix format_string() with \s after 'a'

        Activity

        Hide
        Eloy Lafuente (stronk7) added a comment -

        Found occurrences in:

        lib/filterlib.php
        lib/html2text.php
        mod/book/lib.php
        mod/glossary/lib.php

        all them should be ok now. The book and htm2text ones are slightly different from simply adding \s.

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Found occurrences in: lib/filterlib.php lib/html2text.php mod/book/lib.php mod/glossary/lib.php all them should be ok now. The book and htm2text ones are slightly different from simply adding \s. Ciao
        Hide
        Petr Škoda added a comment -

        thanks!

        Show
        Petr Škoda added a comment - thanks!

          People

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

            Dates

            • Created:
              Updated:
              Resolved: