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

Review filter_censor behaviors and cover it with unit tests

    XMLWordPrintable

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.10.6, 3.11.2, 4.0
    • None
    • Filters
    • MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_400_STABLE

    Description

      This while discovered testing MDL-72242, which testing instructions used filter_censor to verify some behaviors.

      In that issue it was detected that the filter is behaving strangely, with the following details:

      1. It simply doesn't work. Create any content with the HTML editor having the "qqqq" word (for example). Then enable the filter and add that word to the configuration. Refresh the content page and nothing happens.
      2. Extremely fun result if using when the configured words include a word like "<qqqq", (containing < or > chars). In that case all the contents become completely broken showing a lot of "internal" stuff (strings like {{<%1%0%>}}..).
      3. The filter lacks any unit test.

      So, basically, unless I'm missing something, the filter is not working at all. Initially I thought that it maybe because of the order of the filters (I had a lot enabled) because I couldn't believe what I was getting. But have tried disabling all the filters (keeping only the censor one) and very same results.

      Ciao

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              stronk7 Eloy Lafuente (stronk7)
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: