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

Policy (and other) HTML can break with multilang



    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.9.2
    • Fix Version/s: None
    • Component/s: Filters, HTML and CSS, Language
    • Labels:
    • Affected Branches:


      I originally thought this was Atto-related, but it turns out the same thing happens when you set your HTML editor preference to be the basic text editor.

      I also thought it only applied to the user policy editor, (where this effect can be seen both in the policy and the summary) but later found other places that it affects.

      It seems that any mildly complex HTML in combination with the multi-lang filter will cause problems, but not in every location where you can enter text.

      <span lang="en" class="multilang">
      <span lang="fr" class="multilang">

      When the above is saved something, I'm not sure what, is rewriting that so that it looks like this:

      <span lang="en" class="multilang">
      <span lang="fr" class="multilang">

      and therefore breaking the multilang behaviour, as the spans no longer wrap the relevant text.

      Without any html tags like <p> or <div> inside the span, it works as expected.

      Also, the same thing appears to work fine in some places, e.g. a label or a a desciption for a forum, but then not in a forum post, where the same behaviour is seen.

      Possibly this is something to do with security, and some areas are put through more extensive checks than others for XSS etc?

      Worth noting that technically, divs, p tags etc. aren't allowed inside spans, but I believe that's what you need to use for this multilang filter. (I think there is a 3rd party one that supports using {} instead of html tags).






            Unassigned Unassigned
            bawjaws David Scotson
            Component watchers:
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), Amy Groshek, David Scotson, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona), David Mudrák (@mudrd8mz), Helen Foster, Víctor Déniz Falcón
            0 Vote for this issue
            3 Start watching this issue