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

HTML tags appear in page titles when formatstringstriptags is disabled

    XMLWordPrintable

Details

    • MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • MOODLE_22_STABLE, MOODLE_23_STABLE
    • Hide

      With formatstringstriptags disabled

      1. Go to Site Admin > Appearance > HTML Settings and make sure "Remove HTML tags from all activity names" is checked
      2. Create a course
      3. Add an activity (any will do but lets say a quiz)
      4. Give activity the name "<span style="font-size:2em;">My Quiz</span>" and save
      5. View the activity

      Result:

      The activity will be created. When viewed the activity on the page the title will exclude the tags e.g. it will be "My Quiz". The font size will be normal and the browser title won't include any tags.

      With formatstringstriptags enabled

      1. Go to Site Admin > Appearance > HTML Settings and make sure "Remove HTML tags from all activity names" is not checked
      2. Create a course
      3. Add an activity (any will do but lets say a quiz)
      4. Give activity the name "<span style="font-size:2em;">My Quiz</span>" and save
      5. View the activity

      Result:

      The activity will be created. The browser title bar will still exclude the tags e.g. it will be "My Quiz". The activity name will now include the tags, so the activity name on the page will be in a large font.

      No HTML tags in the activity name

      If the activity name doesn't include HTML tags then the result is the same with formatstringstriptags on or off - the activity name should be displayed unchanged in the title.

      Show
      With formatstringstriptags disabled Go to Site Admin > Appearance > HTML Settings and make sure "Remove HTML tags from all activity names" is checked Create a course Add an activity (any will do but lets say a quiz) Give activity the name "<span style="font-size:2em;">My Quiz</span>" and save View the activity Result: The activity will be created. When viewed the activity on the page the title will exclude the tags e.g. it will be "My Quiz". The font size will be normal and the browser title won't include any tags. With formatstringstriptags enabled Go to Site Admin > Appearance > HTML Settings and make sure "Remove HTML tags from all activity names" is not checked Create a course Add an activity (any will do but lets say a quiz) Give activity the name "<span style="font-size:2em;">My Quiz</span>" and save View the activity Result: The activity will be created. The browser title bar will still exclude the tags e.g. it will be "My Quiz". The activity name will now include the tags, so the activity name on the page will be in a large font. No HTML tags in the activity name If the activity name doesn't include HTML tags then the result is the same with formatstringstriptags on or off - the activity name should be displayed unchanged in the title.

    Description

      If formatstringstriptags is disabled (so HTML is allowed in activity names), then viewing most activities will lead to the tags appearing in the page title.

      Replication steps:

      1. Go to Site Admin > Appearance > HTML Settings and uncheck "Remove HTML tags from all activity names"
      2. Create a course
      3. Add an activity (any will do but lets say a quiz)
      4. Give activity the name "<span style="font-size:2em;">My Quiz</span>" and save
      5. Click to enter the quiz

      Expected result: The HTML tags should be stripped from the title.

      Actual result: The browser title bar will include the tags from the activity name, e.g. the title will be:

      test course: <span style="font-size:2em;">My Quiz</span>

      Attachments

        Activity

          People

            simoncoggins Simon Coggins
            simoncoggins Simon Coggins
            Andrew Davis Andrew Davis
            Sam Hemelryk Sam Hemelryk
            David Monllaó David Monllaó
            Amaia Anabitarte, Carlos Escobedo, Laurent David, Sabina Abellan, Sara Arjona (@sarjona), David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12/Nov/12