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

Shorten text can cause invalid HTML

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.3.2, 2.4.3, 2.5
    • 2.3.7, 2.4.4
    • Libraries

    Description

      Add this unit test to lib/tests/moodlelib_test.php.

          function test_shorten_text_multilang() {
              $text = '<span lang="en" class="multilang">A</span>' .
                      '<span lang="fr" class="multilang">B</span>';
              $this->assertEquals('<span lang="en" class="multilang">A</span>...', shorten_text($text, 1));
          }
      

      The actual result, right now, is '<span lang="en" ...</span>', so the test fails. Clearly, shorten_text should never return invalid HTML, so this test should pass.

      Attachments

        Activity

          People

            timhunt Tim Hunt
            timhunt Tim Hunt
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              13/May/13