Version 4.7.23
This commit is contained in:
1 parent
7124a02564
commit
25ddeb65d6
1791 files changed
+76990
-44452
No files matched your search
@@ -116,9 +116,16 @@ class _promote extends \IPS\Dispatcher\Controller
|
||||
{
|
||||
try
|
||||
{
|
||||
$response = \IPS\Http\Url::external( "https://api-ssl.bitly.com/v3/shorten" )->setQueryString( array( 'access_token' => $val, 'longUrl' => 'https://www.invisioncommunity.com' ) )->request()->get()->decodeJson();
|
||||
$request = \IPS\Http\Url::external( "https://api-ssl.bitly.com/v4/shorten" )->request()
|
||||
->setHeaders([
|
||||
'Content-Type' => 'application/json',
|
||||
'Authorization' => 'Bearer ' . $val
|
||||
])
|
||||
->post( json_encode( [
|
||||
'long_url' => 'https://www.invisioncommunity.com',
|
||||
] ) );
|
||||
|
||||
if ( $response['status_code'] !== 200 )
|
||||
if ( (int) $request->httpResponseCode !== 201 )
|
||||
{
|
||||
throw new \DomainException("bitly_auth_failed");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user