Skip to content

Commit

Permalink
Added the ability to allow update checks to work with our local URL (…
Browse files Browse the repository at this point in the history
…by allowing self-created SSL certs in http_request_args)

Added license (this should be done much earlier than this, Richard)
Added readme (likewise)
  • Loading branch information
richardtape committed Oct 8, 2018
1 parent 313dacf commit 99f5bb0
Show file tree
Hide file tree
Showing 4 changed files with 736 additions and 5 deletions.
19 changes: 19 additions & 0 deletions lib/class-scheduled-blocks.php
Expand Up @@ -38,6 +38,8 @@ public function add_hooks() {
// Filter the_content to remove appropriate scheduled blocks before Gutenberg parses it
add_filter( 'the_content', array( $this, 'the_content__scheduled_blocks_filter_content' ), 5 );

add_filter( 'http_request_args', array( $this, 'http_request_args__allow_local_https' ), 99, 2 );

}// end add_hooks()

/**
Expand Down Expand Up @@ -402,4 +404,21 @@ public function scheduled_blocks_get_valid_block_types( $with_front = true ) {

}//end scheduled_blocks_get_valid_block_types()

/**
* Allow software license checks when using our .local URL for SSL
*
* @param array $r The current request params
* @param string $url The URL being requested
* @return array The modified params if we're on our local domain.
*/
public function http_request_args__allow_local_https( $r, $url ) {

if ( strpos( $url, 'https://scheduledblocksdotcom.local' ) !== false ) {
$r['sslverify'] = false;
}

return $r;

}// end http_request_args__allow_local_https()

}// end class Scheduled_Blocks

0 comments on commit 99f5bb0

Please sign in to comment.