テスト済み
This commit is contained in:
@@ -39,7 +39,7 @@ namespace Std\Lib;
|
||||
|
||||
use Std\Lib\Curl;
|
||||
use LogType;
|
||||
use Uri\Rfc3986;
|
||||
use Uri\Rfc3986\Uri;
|
||||
|
||||
/**
|
||||
* ActivityPubプロトコルの実装クラス
|
||||
@@ -299,14 +299,14 @@ class ActivityPub {
|
||||
*/
|
||||
public function getWebfinger(): string {
|
||||
if (!ACTIVITYPUB_ENABLED) return '';
|
||||
$domain = str_replace(['http://', 'https://'], '', $this->domain);
|
||||
$uri = new Uri($this->domain);
|
||||
$webfinger = [
|
||||
'subject' => "acct:{$this->actor}@{$domain}",
|
||||
'subject' => "acct:{$this->actor}@{$uri->getHost()}",
|
||||
'links' => [
|
||||
[
|
||||
'rel' => 'self',
|
||||
'type' => 'application/activity+json',
|
||||
'href' => "{$domain}/ap/actor",
|
||||
'href' => "{$this->domain}/ap/actor",
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
@@ -38,7 +38,7 @@ OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
namespace Std\Lib;
|
||||
|
||||
use Result;
|
||||
use Uri\Rfc3986;
|
||||
use Uri\Rfc3986\Uri;
|
||||
|
||||
/**
|
||||
* php_curlへの依存を排除するための独自のCURL実装
|
||||
@@ -365,7 +365,7 @@ class Curl {
|
||||
$port = $uri->getPort() ?? ($scheme === 'https' ? 443 : 80);
|
||||
$path = $uri->getPath();
|
||||
if ($path === '') $path = '/';
|
||||
if (isset($uri->getQuery())) {
|
||||
if (NULL !== $uri->getQuery()) {
|
||||
$path .= '?'.$uri->getQuery();
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ class Curl {
|
||||
if ($redirectUrl[0] === '/') {
|
||||
$uri = new Uri($currentUrl);
|
||||
$redirectUrl = $uri->getScheme().'://'.$uri->getHost()
|
||||
.(isset($uri->getPort()) ? ':'.$uri->getPort() : '')
|
||||
.(NULL !== $uri->getPort() ? ':'.$uri->getPort() : '')
|
||||
.$redirectUrl;
|
||||
} else {
|
||||
$redirectUrl = dirname($currentUrl).'/'.$redirectUrl;
|
||||
|
||||
Reference in New Issue
Block a user