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

Filter applies multiple times for labels

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.0
    • 2.0
    • Filters
    • None
    • Using latest version from git 51f96f5bd94294e0ff6fbab74e8dbb34d571c9e0 .
    • Any
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

      Filters 2.0 do not work correctly when displaying a label in a course.
      I have created a simple filter:
      function filter($text)

      { return str_replace('world', 'world hello world!', $text); }

      When text "world" is used in a resource, filter works as expected, but in label string "world" is replaced multiple times.
      For a given text in a label:
      "world"
      filter will behave like this:
      1. replace "world" with "world hello world!"
      2. replace each "world" inside "world hello world!" with "world hello world!"

      This gives the end result:
      "world hello world! hello world hello world!!"

            stronk7 Eloy Lafuente (stronk7)
            tmuras Tomasz Muras
            Nobody Nobody
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.