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

shorten_text sometimes omits close tags

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.5
    • Fix Version/s: 1.9.7
    • Component/s: Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      The core function shorten_text is supposed to close any HTML tags that it cuts off. However this only occurs sometimes, depending on the parameters. The sequence of events that occurs is:

      • Function divides input into blocks starting with each tag (open/close/empty)
      • Loops through these input 'lines' until there is more text than the shorten_text allows

      At this point, any tags that are not closed (ie that would be closed in future 'lines') are safe - they will be closed.

      • Goes back looking for a space or suitable breakpoint to chop the text so it is under the limit

      During this process close tags may be chopped off. These are not re-added.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Nov/09