]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/plugin.php
Merge branch '1.0.x' into profile-fixups
[quix0rs-gnu-social.git] / lib / plugin.php
index 1ca5deb5c5e08297448608856c94823b382ddb36..0e8c0a742d92f4deb25a35a7da2bfc01f45d04ed 100644 (file)
@@ -143,20 +143,33 @@ class Plugin
             $server = common_config('plugins', 'server');
         }
 
-        if (is_null($server)) {
+        if (empty($server)) {
             if ($isHTTPS) {
                 $server = common_config('site', 'sslserver');
-            } else {
+            }
+            if (empty($server)) {
                 $server = common_config('site', 'server');
             }
         }
 
-        $path = common_config('plugins', 'path');
+        if ($isHTTPS) {
+            $path = common_config('plugins', 'sslpath');
+        } else {
+            $path = common_config('plugins', 'path');
+        }
 
-        if (is_null($path)) {
+        if (empty($path)) {
             $path = common_config('site', 'path') . '/plugins/';
         }
 
+        if ($path[strlen($path)-1] != '/') {
+            $path .= '/';
+        }
+
+        if ($path[0] != '/') {
+            $path = '/'.$path;
+        }
+
         $protocol = ($isHTTPS) ? 'https' : 'http';
 
         return $protocol.'://'.$server.$path.$plugin.'/'.$relative;