kopia lustrzana https://github.com/friendica/friendica
				
				
				
			Replace custom WebFinger implementation by Probe::getWebfingerArray in APContact::fetchWebfingerData
- This implementation didn't support separate domains for the address and the final accountpull/12736/head
							rodzic
							
								
									91d8cd2c87
								
							
						
					
					
						commit
						79dc5c177e
					
				|  | @ -71,21 +71,14 @@ class APContact | |||
| 			return $data; | ||||
| 		} | ||||
| 
 | ||||
| 		$data = ['addr' => $addr]; | ||||
| 		$template = 'https://' . $addr_parts[1] . '/.well-known/webfinger?resource=acct:' . urlencode($addr); | ||||
| 		$webfinger = Probe::webfinger(str_replace('{uri}', urlencode($addr), $template), HttpClientAccept::JRD_JSON); | ||||
| 		if (empty($webfinger['links'])) { | ||||
| 			$template = 'http://' . $addr_parts[1] . '/.well-known/webfinger?resource=acct:' . urlencode($addr); | ||||
| 			$webfinger = Probe::webfinger(str_replace('{uri}', urlencode($addr), $template), HttpClientAccept::JRD_JSON); | ||||
| 			if (empty($webfinger['links'])) { | ||||
| 		$webfinger = Probe::getWebfingerArray($addr); | ||||
| 		if (empty($webfinger['webfinger']['links'])) { | ||||
| 			return []; | ||||
| 		} | ||||
| 			$data['baseurl'] = 'http://' . $addr_parts[1]; | ||||
| 		} else { | ||||
| 			$data['baseurl'] = 'https://' . $addr_parts[1]; | ||||
| 		} | ||||
| 
 | ||||
| 		foreach ($webfinger['links'] as $link) { | ||||
| 		$data['baseurl'] = $webfinger['baseurl']; | ||||
| 
 | ||||
| 		foreach ($webfinger['webfinger']['links'] as $link) { | ||||
| 			if (empty($link['rel'])) { | ||||
| 				continue; | ||||
| 			} | ||||
|  |  | |||
|  | @ -519,7 +519,7 @@ class Probe | |||
| 	 * @return array Webfinger data | ||||
| 	 * @throws HTTPException\InternalServerErrorException | ||||
| 	 */ | ||||
| 	private static function getWebfingerArray(string $uri): array | ||||
| 	public static function getWebfingerArray(string $uri): array | ||||
| 	{ | ||||
| 		$parts = parse_url($uri); | ||||
| 
 | ||||
|  |  | |||
		Ładowanie…
	
		Reference in New Issue
	
	 Hypolite Petovan
						Hypolite Petovan