Skip to content

Commit

Permalink
Merge pull request #23 from dmitriim/fix-shortname
Browse files Browse the repository at this point in the history
Fix possible issue with shortname for classes outside of the plugin
  • Loading branch information
dmitriim authored Nov 29, 2023
2 parents e8a9e3a + 7306316 commit 605cbcc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion classes/local/block_verify_certs/certificates/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
use admin_settingpage;
use admin_setting_configcheckbox;
use lang_string;
use ReflectionClass;

/**
* Base class for certificates.
Expand Down Expand Up @@ -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();
}

/**
Expand Down

0 comments on commit 605cbcc

Please sign in to comment.