Fix plugin class name mismatch in auto loader (#7350)

* Fix plugin class name mismatch in auto loader
When matching the file name of the plugins in the authentication plugin folder they do not match. This causes auto loader not to find and load the class.

* Update auto_loader.php

---------

Co-authored-by: FusionPBX <markjcrane@gmail.com>
This commit is contained in:
frytimo 2025-04-01 12:07:26 -03:00 committed by GitHub
parent 5c1be1a318
commit 5ed20f1c2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -134,6 +134,11 @@ class auto_loader {
$search_path[] = glob($project_path . "/*/*/resources/interfaces/" . $class_name . ".php"); $search_path[] = glob($project_path . "/*/*/resources/interfaces/" . $class_name . ".php");
$search_path[] = glob($project_path . "/*/*/resources/traits/" . $class_name . ".php"); $search_path[] = glob($project_path . "/*/*/resources/traits/" . $class_name . ".php");
$search_path[] = glob($project_path . "/*/*/resources/classes/" . $class_name . ".php"); $search_path[] = glob($project_path . "/*/*/resources/classes/" . $class_name . ".php");
//fix class names in the plugins directory prefixed with 'plugin_'
if (str_starts_with($class_name, 'plugin_')) {
$class_name = substr($class_name, 7);
}
$search_path[] = glob($project_path . "/core/authentication/resources/classes/plugins/" . $class_name . ".php"); $search_path[] = glob($project_path . "/core/authentication/resources/classes/plugins/" . $class_name . ".php");
//collapse all entries to only the matched entry //collapse all entries to only the matched entry