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

HTML tags appear in page titles when formatstringstriptags is disabled

    Details

    • Testing Instructions:
      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.
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE

      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>

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Nov/12