Moodle Community Sites

Developer chat: Does not handle special characters well

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Component/s: moodle.org
  • Labels:
    None

Description

See linked URL. First comment reads:

query about moodle.org - anyone know how many users have forum mail set to digest? For example this would give a percentage: select 100.0 * (select count(1) from mdl_user where maildigest0) / (select count(1) from mdl_user) AS percentage

Part of this should read:

select count(1) from mdl_user where maildigest<>0

It appears that the HTML special characters < and > have been stripped out entirely. Expected behaviour would be that these are output to the browser as < and > so that they display normally.

I did not test other characters but it might be worth somebody testing & ' and UTF-8 characters eg Chinese/Japanese text).

Activity

Hide
Helen Foster added a comment -

Reassigning to our super-skilled UTF-8 specialist.

Show
Helen Foster added a comment - Reassigning to our super-skilled UTF-8 specialist.
Hide
Eloy Lafuente (stronk7) added a comment -

messages are processed by standard:

format_text() with MOODLE_FORMAT

and MOODLE_FORMAT, when cleaning output, strips unknown tags, afaik.

So I've added one htmlspecialchars() call to get <>& converted to entities before calling format_text()

Seems to be working on now. Ciao

Show
Eloy Lafuente (stronk7) added a comment - messages are processed by standard: format_text() with MOODLE_FORMAT and MOODLE_FORMAT, when cleaning output, strips unknown tags, afaik. So I've added one htmlspecialchars() call to get <>& converted to entities before calling format_text() Seems to be working on now. Ciao

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: