Issue Details (XML | Word | Printable)

Key: MDL-16293
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Eric Merrill
Reporter: A. T. Wyatt
Votes: 2
Watchers: 3
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Background color stripped when submitting after highlighting text in forums

Created: 18/Aug/08 06:44 AM   Updated: 09/Dec/08 10:16 PM
Return to search
Component/s: Filters
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

Environment: unknown
Issue Links:
Relates
 

Participants: A. T. Wyatt, Eric Merrill, Helen Foster, Mathieu Petit-Clair and Petr Skoda
Security Level: None
QA Assignee: Petr Skoda
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  « Hide
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.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Helen Foster added a comment - 01/Sep/08 11:20 PM
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.


Petr Skoda added a comment - 01/Sep/08 11:55 PM
this is a general KSES issue, we should decide what to use in 2.0 instead

Mathieu Petit-Clair added a comment - 02/Sep/08 10:35 AM
Reassigning to filters. For the reason mentionned by Petr, this still happens when the editor is turned off.

Eric Merrill added a comment - 03/Dec/08 11:43 PM
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;"


Eric Merrill added a comment - 04/Dec/08 01:57 AM
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


Eric Merrill added a comment - 04/Dec/08 02:01 AM
I'll leave this open and assigned to Eloy so he can review it, but otherwise this can be resolved.

-eric


Petr Skoda added a comment - 09/Dec/08 10:16 PM
reviewed - closing, thanks