From 73063168329b82f0376b78b35f3f9e8cef75d2c7 Mon Sep 17 00:00:00 2001 From: Dmitrii Metelkin Date: Wed, 29 Nov 2023 19:09:39 +1100 Subject: [PATCH] Fix possible issue with shortname for classes outside of the plugin --- classes/local/block_verify_certs/certificates/base.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/local/block_verify_certs/certificates/base.php b/classes/local/block_verify_certs/certificates/base.php index a09065a..4e250d3 100644 --- a/classes/local/block_verify_certs/certificates/base.php +++ b/classes/local/block_verify_certs/certificates/base.php @@ -20,6 +20,7 @@ use admin_settingpage; use admin_setting_configcheckbox; use lang_string; +use ReflectionClass; /** * Base class for certificates. @@ -60,7 +61,9 @@ public function get_fullname(): string { * @return string */ final public function get_shortname(): string { - return str_replace(__NAMESPACE__ . '\\', '', static::class); + $reflector = new ReflectionClass(static::class); + + return $reflector->getShortName(); } /**