X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fplugin.php;h=0e8c0a742d92f4deb25a35a7da2bfc01f45d04ed;hb=be682a3f8c802fb0f61b38f4689decb10eed1715;hp=2b34834577f3ba9651742b03612a4eb973e872ec;hpb=9efedfc2179e4e4d1476be6b9276f7e4889b8a8a;p=quix0rs-gnu-social.git diff --git a/lib/plugin.php b/lib/plugin.php index 2b34834577..0e8c0a742d 100644 --- a/lib/plugin.php +++ b/lib/plugin.php @@ -143,21 +143,33 @@ class Plugin $server = common_config('plugins', 'server'); } - if (is_null($server)) { + if (empty($server)) { if ($isHTTPS) { $server = common_config('site', 'sslserver'); } - if (is_null($server)) { + 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;