bozoh / moodle-mod_simplecertificate

It's NOT RECOMMENDED to install version below 2.2.6 (MOODLE_31), due a security issues See more in README
17 stars 44 forks source link

broken image links can cause blank certificates #246

Open royko opened 2 years ago

royko commented 2 years ago

Description If the Certificate Text contains an image link such as <img src="https://broken.link/image.jpg">, but the image is not accessible, the certificate text may not render (even though it shows up in the editor with a small broken image icon).

Version(s) Moodle 3.10.6 plugin version 2.2.10 2020041238

To Reproduce Steps to reproduce the behavior:

  1. Edit settings of a simple certificate.
  2. Into the Certificate Text box, enter the following:
    
    This is the text.

The image is above.


3. Between the two lines of text, insert an image with URL "https://broken.link/image.jpg", with size e.g. 50x50.
4. After filling any other required fields, click **Save and Display**.
5. Click **Get Certificate**.
6. The certificate pdf generates, but with only the first line of text.

**Expected behavior**
Both lines of text should be visible, with either nothing, alt text, or a broken image icon between them.

**Desktop:**
 - OS: MacOS
 - Browser: Firefox

**Context:**
While inserting a broken link is an error on the user's part, the problem is that a link to an external image can break after the certificate is configured, resulting in an unexpected change in behaviour.  And since all the text appears in the editor but not on the certificate, the user configuring the settings may be confused.