Moodle
  1. Moodle
  2. MDL-22664

html_to_text stripts images. It should replace the imge with its alt text

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.9.8
    • Fix Version/s: 1.9.10, 2.0
    • Component/s: Accessibility, Libraries
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE, MOODLE_20_STABLE
    • Rank:
      27081

      Description

      This is a regression introduced by MDL-17542.

      Look at http://cvs.moodle.org/moodle/lib/html2text.php?r1=1.10&r2=1.11, and search for img. You will see that in the old library images were replace by their alt text. The new code just strips them. Please could we have a fix, which I guess will have to be contributed upstream.

        Activity

        Hide
        Tim Hunt added a comment -

        Adding a couple of watchers.

        Show
        Tim Hunt added a comment - Adding a couple of watchers.
        Hide
        Tim Hunt added a comment -

        Here is a proposed fix:
        http://github.com/timhunt/Moodle-Question-Engine-2/commit/8169577cb6050690ea4b9b2ff139001471f125c2

        Francois, you have dealt with the upstream people on this before. Please could you take this forwards.

        In the mean time, do we want this committed to any Moodle branches?

        Show
        Tim Hunt added a comment - Here is a proposed fix: http://github.com/timhunt/Moodle-Question-Engine-2/commit/8169577cb6050690ea4b9b2ff139001471f125c2 Francois, you have dealt with the upstream people on this before. Please could you take this forwards. In the mean time, do we want this committed to any Moodle branches?
        Hide
        Tim Hunt added a comment -

        Also, for the code I am writing that uses this, I would like to make this change:

        http://github.com/timhunt/Moodle-Question-Engine-2/commit/ec0c27531e3952c013de4e22c27d6d28412ac034#diff-0

        in weblib, so I can pass through $width = 0. Is it OK if I commit that?

        Show
        Tim Hunt added a comment - Also, for the code I am writing that uses this, I would like to make this change: http://github.com/timhunt/Moodle-Question-Engine-2/commit/ec0c27531e3952c013de4e22c27d6d28412ac034#diff-0 in weblib, so I can pass through $width = 0. Is it OK if I commit that?
        Hide
        Petr Škoda added a comment -

        +1 for commit

        Show
        Petr Škoda added a comment - +1 for commit
        Hide
        Tim Hunt added a comment -

        Checked in to 1.9 and HEAD, which a few simple unit tests.

        Show
        Tim Hunt added a comment - Checked in to 1.9 and HEAD, which a few simple unit tests.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: