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

Base 64 images not supported in glossary

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.1.6, 3.2.3
    • None
    • Glossary
    • MOODLE_31_STABLE, MOODLE_32_STABLE

    Description

      Manually creating a glossary item with a base 64 image / data url, the image is removed for no reason

       <p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAXoAAAC1CAIAAADeC6MSAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADeSU
      RBVHhe7cExAQAAAMKg9U9tCF8gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgFcNIqgAAR64vmIAAAAASUVORK5CYII=" /></p>

      This was originally reported as being a problem with the glossary import. But in reality import is working fine, it's just we disallow base64 / data url images for no documented reason. Original report:

      I'm using moodle 3.1 , I'm assuming Marina's patches are installed.

      I find that images inserted into the glossary using the picture icon on the toolbar appear, when exported, under the FILE tag in the xml file. Those xml files can be re-imported with no problem.

      base64 images placed within the IMG tag in the html also work (and are exported) when pasted into the source code editing area in a glossary entry.

      However, base64 images in the IMG tag in an XML import, even one generated by export from moodle, will not import. The import procedure seems to throw the base64 code away.

      Replication:
      1. Create a new glossary and a new glossary entry
      2. Edit the source code for the definition of the glossary entry and include a image encoded in base64 in an IMG tag in the html (e.g. https://jsfiddle.net/casiano/xadvz/)
      3. Export the glossary to xml
      4. create a new glossary and import the xml you exported before. The imported entry will not include the image.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              siderob robert2018
              Ilya Tregubov, Kevin Percy, Mathew May, Mihail Geshoski, Shamim Rezaie
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: