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

Certificates issued on the hour or 1 minute over have {USERNAME} attribute missing (in a server on PHP 7.3) #262

Closed harriholappa closed 1 year ago

harriholappa commented 1 year ago

Describe the bug Certificates issued on the hour or 1 minute over have {USERNAME} attribute missing (in a server on PHP 7.3)

Moodle Version(s) Moodle 3.9 mod_simplecertificate 2.2.10 (2020041238)

To Reproduce Steps to reproduce the behavior:

  1. Have some already issued certificates listed in the 'Issued certificates' tab. Make sure you have some issued exactly on the hour or one minute over (for example 10:00 or 10:01). Have your PHP version be 7.3
  2. Open a issued certificate that has the time like this. Notice how {USERNAME} attribute is missing.
  3. Update the PHP version to 7.4
  4. Open an issued certificate that has been issued after the update and has the issued time on the hour or one minute over. Notice that the {USERNAME} attribute is visible. The certificates issued on PHP 7.3 still have the attribute missing.

Expected behavior {USERNAME} attribute should be always visible

Additional context As you can probably guess, I did not actually reproduce the error by spinning up new servers and Moodle installations. I simply noticed this behaviour by opening up certificates in one of our production sites and deduced that the PHP version update is the likely explanation why this behaviour changed in newer certificates.

harriholappa commented 1 year ago

This was a problem with the plugin filter_filtercodes. This bug did not have anything to do with PHP 7.3. Inactivating Filter Codes from the course fixed the problem with the {USERNAME} attribute in certificates.