Skip to content

Commit 79ff878

Browse files
committed
Test success of get_account_subdomain request, before using it.
1 parent 52282eb commit 79ff878

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

cloudflare-stream.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* Description: Cloudflare Stream Video is an easy-to-use, affordable, on-demand video streaming platform. Stream seamlessly integrates video storage, encoding, and a customizable player with Cloudflare’s fast, secure, and reliable global network, so that you can spend less time managing video delivery and more time building and promoting your product.
66
* Author: Cloudflare, B-Interactive, davidpurdy
77
* Author URI: https://github.com/B-Interactive/cloudflare-stream-wordpress
8-
* Version: 1.0.9
8+
* Version: 1.0.9.1
99
* License: GPL2+
1010
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
1111
* Text Domain: cloudflare-stream-wordpress

readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Plugin Name: Cloudflare Stream Video
33
Plugin URI: https://github.com/B-Interactive/cloudflare-stream-wordpress
44
Description: Cloudflare Stream is an easy-to-use, affordable, on-demand video streaming platform. The Stream video plugin for WordPress lets you upload videos to Cloudflare where they are securely stored and encoded for native streaming directly from the WordPress editor.
5-
Version: 1.0.9
5+
Version: 1.0.9.1
66
Author: Cloudflare
77
Author URI: https://www.cloudflare.com/products/stream-delivery/
88
Contributors: cloudflare, stevenkword, B-Interactive, davidpurdy

src/inc/class-cloudflare-stream-api.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,11 @@ public function delete_video( $uid, $args = array(), $return_headers = false ) {
346346
*/
347347
public function get_account_subdomain( $args = array(), $return_headers = false ) {
348348
$response_text = json_decode( $this->request( 'stream/', $args, $return_headers ) );
349-
if ( count($response_text->result) > 0 ) {
350-
$text_array = explode( "/", $response_text->result[0]->thumbnail );
351-
return $text_array[2];
349+
if ( $response_text->success ) {
350+
if ( count($response_text->result) > 0 ) {
351+
$text_array = explode( "/", $response_text->result[0]->thumbnail );
352+
return $text_array[2];
353+
}
352354
}
353355
return false;
354356
}

0 commit comments

Comments
 (0)