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

Text is truncated when saved if a < is immediatly followed by (an)other character(s), and not by a space

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.11.7, 4.0.1
    • General
    • None
    • MOODLE_311_STABLE, MOODLE_400_STABLE

      Hi,

      First discovered a problem specified in MDL-74947, i now realise it's something (more) general : when in a text field, if you insert a < character followed by (an)other character(s), and not by a space, when saving the value (the whole form), it's truncated at the < place.

      If you use :

      • "rtyu < 99" => "rtyu < 99"
      • "rtyu< 99" => "rtyu< 99"
      • "rtyu <99" => "rtyu "
      • "rtyu<99" => "rtyu"

      In short, the text is truncated when a < character is immediatly followed by another character, and not by a space!

      It's the case in lot of places. In fact, it seems related to the fact that the field is in PARAM_TEXT (and not in PARAM_RAW). I suspect this type of field is made (and cleaned) to avoid insertion of bad code in the database.

      Could this be improved to clean text while allowing to insert such < character?

      I think MDL-46754 is somehow related.

      Séverin

            Unassigned Unassigned
            fox Séverin Terrier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.