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

Shorten text can cause invalid HTML

XMLWordPrintable

      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.

            timhunt Tim Hunt
            timhunt Tim Hunt
            Dan Poltawski Dan Poltawski
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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