-
Bug
-
Resolution: Cannot Reproduce
-
Major
-
None
-
4.5.1
-
None
-
MOODLE_405_STABLE
When adding an image to a Moodle page resource and wrapping it within a <pre> HTML tag, the image is visible to teachers but disappears for students. This issue affects the "Page" resource and also occurs in other resource types or activity descriptions.
Steps to reproduce the issue
- Log in as a teacher.
- Create a page resource in any course.
- Add an image to the page.
- Select the image and:
Format it as "Preformatted," or
Manually edit the HTML to wrap the <img> tag within a <pre> tag. - Save and view the page:
As a teacher, the image is visible. - Log in as a student and view the same page:
As a student, the image is not visible, and the <img> tag is missing from the generated HTML.
Expected behavior
The image should remain visible to all users, including students, regardless of whether it is placed inside a <pre> tag.
Actual behavior
The <img> tag is removed from the HTML for students when it is placed inside a <pre> tag, making the image invisible. However, teachers can still view the image.
Additional note: The issue could be related to a content filtering or sanitization mechanism that behaves differently for students and teachers.