]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/plugin.php
Implemented WebFinger and replaced our XRD with PEAR XML_XRD
[quix0rs-gnu-social.git] / lib / plugin.php
index f97a07fe5ae5cae34da4a9b1e56c9c7fce82bc69..80a3e96207e3001d64c652a4fdbf12c993dcf922 100644 (file)
@@ -105,11 +105,15 @@ class Plugin
         if (preg_match('/^(\w+)(Action|Form)$/', $cls, $type)) {
             $type = array_map('strtolower', $type);
             $file = "$basedir/{$type[2]}s/{$type[1]}.php";
-        } else {
+        }
+        if (!file_exists($file)) {
             $file = "$basedir/classes/{$cls}.php";
 
+            // library files can be put into subdirs ('_'->'/' conversion)
+            // such as LRDDMethod_WebFinger -> lib/lrddmethod/webfinger.php
             if (!file_exists($file)) {
                 $type = strtolower($cls);
+                $type = str_replace('_', '/', $type);
                 $file = "$basedir/lib/{$type}.php";
             }
         }