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

Background color stripped when submitting after highlighting text in forums

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.7, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.9, 1.9.1, 1.9.2, 1.9.3
    • Fix Version/s: 1.6.9, 1.7.7, 1.8.8, 1.9.4, 2.0
    • Component/s: Filters
    • Labels:
      None
    • Environment:
      unknown
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      I have noticed for a while that if you using the html editor to post a reply in the forums and try to highlight some text (for example, some important bit of code) it works if you use TEXT color, but not BACKGROUND color. The background color displays until you submit the changes, and then it disappears.

      <span style="background-color: rgb(204, 255, 153);">writing</span>

      becomes

      <span">writing</span>

      I think this is a bug.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            tsala Helen Foster added a comment -

            atw, thanks for reporting this issue, which appears to affect Moodle in general, and not just moodle.org.

            Reassigning to HTML editor component lead, Mathieu.

            Show
            tsala Helen Foster added a comment - atw, thanks for reporting this issue, which appears to affect Moodle in general, and not just moodle.org. Reassigning to HTML editor component lead, Mathieu.
            Hide
            skodak Petr Skoda added a comment -

            this is a general KSES issue, we should decide what to use in 2.0 instead

            Show
            skodak Petr Skoda added a comment - this is a general KSES issue, we should decide what to use in 2.0 instead
            Hide
            scyrma Mathieu Petit-Clair added a comment -

            Reassigning to filters. For the reason mentionned by Petr, this still happens when the editor is turned off.

            Show
            scyrma Mathieu Petit-Clair added a comment - Reassigning to filters. For the reason mentionned by Petr, this still happens when the editor is turned off.
            Hide
            emerrill Eric Merrill added a comment -

            Yeah, this happens during display, not saving - when you go back and edit an item, it still has the tags, but when you view it, it strips them.

            The code will have something like:
            span style="background-color: #ffff00;"

            but this is printed out:
            span style="#ffff00;"

            Show
            emerrill Eric Merrill added a comment - Yeah, this happens during display, not saving - when you go back and edit an item, it still has the tags, but when you view it, it strips them. The code will have something like: span style="background-color: #ffff00;" but this is printed out: span style="#ffff00;"
            Hide
            emerrill Eric Merrill added a comment -

            Problem found.

            You need to add 'background-color' to the $ALLOWED_PROTOCOLS array at line 102 in lib/weblib.php

            Merged into HEAD, MOODLE_19_STABLE, MOODLE_18_STABLE, MOODLE_17_STABLE, and MOODLE_16_STABLE

            Show
            emerrill Eric Merrill added a comment - Problem found. You need to add 'background-color' to the $ALLOWED_PROTOCOLS array at line 102 in lib/weblib.php Merged into HEAD, MOODLE_19_STABLE, MOODLE_18_STABLE, MOODLE_17_STABLE, and MOODLE_16_STABLE
            Hide
            emerrill Eric Merrill added a comment -

            I'll leave this open and assigned to Eloy so he can review it, but otherwise this can be resolved.

            -eric

            Show
            emerrill Eric Merrill added a comment - I'll leave this open and assigned to Eloy so he can review it, but otherwise this can be resolved. -eric
            Hide
            skodak Petr Skoda added a comment -

            reviewed - closing, thanks

            Show
            skodak Petr Skoda added a comment - reviewed - closing, thanks

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  28/Jan/09