Merge pull request #127 from eai04191/feature/patreon-esolver-fix
PatreonResolverにてtoken-timeがある場合のみexpires_atを指定するように変更
This commit is contained in:
commit
dab1732a1d
@ -28,11 +28,11 @@ class PatreonResolver implements Resolver
|
|||||||
if ($res->getStatusCode() === 200) {
|
if ($res->getStatusCode() === 200) {
|
||||||
$metadata = $this->ogpResolver->parse($res->getBody());
|
$metadata = $this->ogpResolver->parse($res->getBody());
|
||||||
|
|
||||||
parse_str(parse_url($metadata->image, PHP_URL_QUERY), $temp);
|
parse_str(parse_url($metadata->image, PHP_URL_QUERY), $query);
|
||||||
$expires_at_unixtime = $temp['token-time'];
|
if (isset($query['token-time'])) {
|
||||||
$expires_at = Carbon::createFromTimestamp($expires_at_unixtime);
|
$expires_at_unixtime = $query['token-time'];
|
||||||
|
$metadata->expires_at = Carbon::createFromTimestamp($expires_at_unixtime);
|
||||||
$metadata->expires_at = $expires_at;
|
}
|
||||||
|
|
||||||
return $metadata;
|
return $metadata;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user